From 74fab50d5dc95951e09f7460d0618571d806afb0 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 15 May 2017 15:59:14 +0200 Subject: [PATCH] consolidate build package.json --- build/lib/bundle.js | 906 +- build/lib/compilation.js | 342 +- build/lib/extensions.js | 192 +- build/lib/git.js | 106 +- build/lib/i18n.js | 2097 +- build/lib/i18n.ts | 142 +- build/lib/nls.js | 710 +- build/lib/optimize.js | 470 +- build/lib/reporter.js | 166 +- build/lib/reporter.ts | 2 +- build/lib/test/i18n.test.js | 80 +- build/lib/tslint/allowAsyncRule.js | 118 +- build/lib/tslint/allowAsyncRule.ts | 2 +- build/lib/tslint/duplicateImportsRule.js | 100 +- build/lib/tslint/importPatternsRule.js | 114 +- build/lib/tslint/layeringRule.js | 170 +- .../lib/tslint/noUnexternalizedStringsRule.js | 354 +- build/lib/typings/lib.es6.d.ts | 18296 ---------------- build/lib/typings/node.d.ts | 1536 -- build/lib/util.js | 426 +- build/lib/util.ts | 40 +- build/monaco/api.js | 654 +- build/package.json | 16 +- build/tfs/common/package.json | 27 - build/tfs/common/tsconfig.json | 11 - build/tsconfig.json | 6 +- build/{tfs/common => }/tslint.json | 0 27 files changed, 3612 insertions(+), 23471 deletions(-) delete mode 100644 build/lib/typings/lib.es6.d.ts delete mode 100644 build/lib/typings/node.d.ts delete mode 100644 build/tfs/common/package.json delete mode 100644 build/tfs/common/tsconfig.json rename build/{tfs/common => }/tslint.json (100%) diff --git a/build/lib/bundle.js b/build/lib/bundle.js index 8914c89c919..5a51bde2156 100644 --- a/build/lib/bundle.js +++ b/build/lib/bundle.js @@ -1,453 +1,453 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var fs = require("fs"); -var path = require("path"); -var vm = require("vm"); -/** - * Bundle `entryPoints` given config `config`. - */ -function bundle(entryPoints, config, callback) { - var entryPointsMap = {}; - entryPoints.forEach(function (module) { - entryPointsMap[module.name] = module; - }); - var allMentionedModulesMap = {}; - entryPoints.forEach(function (module) { - allMentionedModulesMap[module.name] = true; - (module.include || []).forEach(function (includedModule) { - allMentionedModulesMap[includedModule] = true; - }); - (module.exclude || []).forEach(function (excludedModule) { - allMentionedModulesMap[excludedModule] = true; - }); - }); - var code = require('fs').readFileSync(path.join(__dirname, '../../src/vs/loader.js')); - var r = vm.runInThisContext('(function(require, module, exports) { ' + code + '\n});'); - var loaderModule = { exports: {} }; - r.call({}, require, loaderModule, loaderModule.exports); - var loader = loaderModule.exports; - config.isBuild = true; - loader.config(config); - loader(['require'], function (localRequire) { - var resolvePath = function (path) { - var r = localRequire.toUrl(path); - if (!/\.js/.test(r)) { - return r + '.js'; - } - return r; - }; - for (var moduleId in entryPointsMap) { - var entryPoint = entryPointsMap[moduleId]; - if (entryPoint.append) { - entryPoint.append = entryPoint.append.map(resolvePath); - } - if (entryPoint.prepend) { - entryPoint.prepend = entryPoint.prepend.map(resolvePath); - } - } - }); - loader(Object.keys(allMentionedModulesMap), function () { - var modules = loader.getBuildInfo(); - var partialResult = emitEntryPoints(modules, entryPointsMap); - var cssInlinedResources = loader('vs/css').getInlinedResources(); - callback(null, { - files: partialResult.files, - cssInlinedResources: cssInlinedResources, - bundleData: partialResult.bundleData - }); - }, function (err) { return callback(err, null); }); -} -exports.bundle = bundle; -function emitEntryPoints(modules, entryPoints) { - var modulesMap = {}; - modules.forEach(function (m) { - modulesMap[m.id] = m; - }); - var modulesGraph = {}; - modules.forEach(function (m) { - modulesGraph[m.id] = m.dependencies; - }); - var sortedModules = topologicalSort(modulesGraph); - var result = []; - var usedPlugins = {}; - var bundleData = { - graph: modulesGraph, - bundles: {} - }; - Object.keys(entryPoints).forEach(function (moduleToBundle) { - var info = entryPoints[moduleToBundle]; - var rootNodes = [moduleToBundle].concat(info.include || []); - var allDependencies = visit(rootNodes, modulesGraph); - var excludes = ['require', 'exports', 'module'].concat(info.exclude || []); - excludes.forEach(function (excludeRoot) { - var allExcludes = visit([excludeRoot], modulesGraph); - Object.keys(allExcludes).forEach(function (exclude) { - delete allDependencies[exclude]; - }); - }); - var includedModules = sortedModules.filter(function (module) { - return allDependencies[module]; - }); - bundleData.bundles[moduleToBundle] = includedModules; - var res = emitEntryPoint(modulesMap, modulesGraph, moduleToBundle, includedModules, info.prepend, info.append, info.dest); - result = result.concat(res.files); - for (var pluginName in res.usedPlugins) { - usedPlugins[pluginName] = usedPlugins[pluginName] || res.usedPlugins[pluginName]; - } - }); - Object.keys(usedPlugins).forEach(function (pluginName) { - var plugin = usedPlugins[pluginName]; - if (typeof plugin.finishBuild === 'function') { - var write = function (filename, contents) { - result.push({ - dest: filename, - sources: [{ - path: null, - contents: contents - }] - }); - }; - plugin.finishBuild(write); - } - }); - return { - // TODO@TS 2.1.2 - files: extractStrings(removeDuplicateTSBoilerplate(result)), - bundleData: bundleData - }; -} -function extractStrings(destFiles) { - var parseDefineCall = function (moduleMatch, depsMatch) { - var module = moduleMatch.replace(/^"|"$/g, ''); - var deps = depsMatch.split(','); - deps = deps.map(function (dep) { - dep = dep.trim(); - dep = dep.replace(/^"|"$/g, ''); - dep = dep.replace(/^'|'$/g, ''); - var prefix = null; - var _path = null; - var pieces = dep.split('!'); - if (pieces.length > 1) { - prefix = pieces[0] + '!'; - _path = pieces[1]; - } - else { - prefix = ''; - _path = pieces[0]; - } - if (/^\.\//.test(_path) || /^\.\.\//.test(_path)) { - var res = path.join(path.dirname(module), _path).replace(/\\/g, '/'); - return prefix + res; - } - return prefix + _path; - }); - return { - module: module, - deps: deps - }; - }; - destFiles.forEach(function (destFile, index) { - if (!/\.js$/.test(destFile.dest)) { - return; - } - if (/\.nls\.js$/.test(destFile.dest)) { - return; - } - // Do one pass to record the usage counts for each module id - var useCounts = {}; - destFile.sources.forEach(function (source) { - var matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/); - if (!matches) { - return; - } - var defineCall = parseDefineCall(matches[1], matches[2]); - useCounts[defineCall.module] = (useCounts[defineCall.module] || 0) + 1; - defineCall.deps.forEach(function (dep) { - useCounts[dep] = (useCounts[dep] || 0) + 1; - }); - }); - var sortedByUseModules = Object.keys(useCounts); - sortedByUseModules.sort(function (a, b) { - return useCounts[b] - useCounts[a]; - }); - var replacementMap = {}; - sortedByUseModules.forEach(function (module, index) { - replacementMap[module] = index; - }); - destFile.sources.forEach(function (source) { - source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, function (_, moduleMatch, depsMatch) { - var defineCall = parseDefineCall(moduleMatch, depsMatch); - return "define(__m[" + replacementMap[defineCall.module] + "/*" + defineCall.module + "*/], __M([" + defineCall.deps.map(function (dep) { return replacementMap[dep] + '/*' + dep + '*/'; }).join(',') + "])"; - }); - }); - destFile.sources.unshift({ - path: null, - contents: [ - '(function() {', - "var __m = " + JSON.stringify(sortedByUseModules) + ";", - "var __M = function(deps) {", - " var result = [];", - " for (var i = 0, len = deps.length; i < len; i++) {", - " result[i] = __m[deps[i]];", - " }", - " return result;", - "};" - ].join('\n') - }); - destFile.sources.push({ - path: null, - contents: '}).call(this);' - }); - }); - return destFiles; -} -function removeDuplicateTSBoilerplate(destFiles) { - // Taken from typescript compiler => emitFiles - var BOILERPLATE = [ - { start: /^var __extends/, end: /^}\)\(\);$/ }, - { start: /^var __assign/, end: /^};$/ }, - { start: /^var __decorate/, end: /^};$/ }, - { start: /^var __metadata/, end: /^};$/ }, - { start: /^var __param/, end: /^};$/ }, - { start: /^var __awaiter/, end: /^};$/ }, - ]; - destFiles.forEach(function (destFile) { - var SEEN_BOILERPLATE = []; - destFile.sources.forEach(function (source) { - var lines = source.contents.split(/\r\n|\n|\r/); - var newLines = []; - var IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE; - for (var i = 0; i < lines.length; i++) { - var line = lines[i]; - if (IS_REMOVING_BOILERPLATE) { - newLines.push(''); - if (END_BOILERPLATE.test(line)) { - IS_REMOVING_BOILERPLATE = false; - } - } - else { - for (var j = 0; j < BOILERPLATE.length; j++) { - var boilerplate = BOILERPLATE[j]; - if (boilerplate.start.test(line)) { - if (SEEN_BOILERPLATE[j]) { - IS_REMOVING_BOILERPLATE = true; - END_BOILERPLATE = boilerplate.end; - } - else { - SEEN_BOILERPLATE[j] = true; - } - } - } - if (IS_REMOVING_BOILERPLATE) { - newLines.push(''); - } - else { - newLines.push(line); - } - } - } - source.contents = newLines.join('\n'); - }); - }); - return destFiles; -} -function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend, append, dest) { - if (!dest) { - dest = entryPoint + '.js'; - } - var mainResult = { - sources: [], - dest: dest - }, results = [mainResult]; - var usedPlugins = {}; - var getLoaderPlugin = function (pluginName) { - if (!usedPlugins[pluginName]) { - usedPlugins[pluginName] = modulesMap[pluginName].exports; - } - return usedPlugins[pluginName]; - }; - includedModules.forEach(function (c) { - var bangIndex = c.indexOf('!'); - if (bangIndex >= 0) { - var pluginName = c.substr(0, bangIndex); - var plugin = getLoaderPlugin(pluginName); - mainResult.sources.push(emitPlugin(entryPoint, plugin, pluginName, c.substr(bangIndex + 1))); - return; - } - var module = modulesMap[c]; - if (module.path === 'empty:') { - return; - } - var contents = readFileAndRemoveBOM(module.path); - if (module.shim) { - mainResult.sources.push(emitShimmedModule(c, deps[c], module.shim, module.path, contents)); - } - else { - mainResult.sources.push(emitNamedModule(c, deps[c], module.defineLocation, module.path, contents)); - } - }); - Object.keys(usedPlugins).forEach(function (pluginName) { - var plugin = usedPlugins[pluginName]; - if (typeof plugin.writeFile === 'function') { - var req = (function () { - throw new Error('no-no!'); - }); - req.toUrl = function (something) { return something; }; - var write = function (filename, contents) { - results.push({ - dest: filename, - sources: [{ - path: null, - contents: contents - }] - }); - }; - plugin.writeFile(pluginName, entryPoint, req, write, {}); - } - }); - var toIFile = function (path) { - var contents = readFileAndRemoveBOM(path); - return { - path: path, - contents: contents - }; - }; - var toPrepend = (prepend || []).map(toIFile); - var toAppend = (append || []).map(toIFile); - mainResult.sources = toPrepend.concat(mainResult.sources).concat(toAppend); - return { - files: results, - usedPlugins: usedPlugins - }; -} -function readFileAndRemoveBOM(path) { - var BOM_CHAR_CODE = 65279; - var contents = fs.readFileSync(path, 'utf8'); - // Remove BOM - if (contents.charCodeAt(0) === BOM_CHAR_CODE) { - contents = contents.substring(1); - } - return contents; -} -function emitPlugin(entryPoint, plugin, pluginName, moduleName) { - var result = ''; - if (typeof plugin.write === 'function') { - var write = (function (what) { - result += what; - }); - write.getEntryPoint = function () { - return entryPoint; - }; - write.asModule = function (moduleId, code) { - code = code.replace(/^define\(/, 'define("' + moduleId + '",'); - result += code; - }; - plugin.write(pluginName, moduleName, write); - } - return { - path: null, - contents: result - }; -} -function emitNamedModule(moduleId, myDeps, defineCallPosition, path, contents) { - // `defineCallPosition` is the position in code: |define() - var defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col); - // `parensOffset` is the position in code: define|() - var parensOffset = contents.indexOf('(', defineCallOffset); - var insertStr = '"' + moduleId + '", '; - return { - path: path, - contents: contents.substr(0, parensOffset + 1) + insertStr + contents.substr(parensOffset + 1) - }; -} -function emitShimmedModule(moduleId, myDeps, factory, path, contents) { - var strDeps = (myDeps.length > 0 ? '"' + myDeps.join('", "') + '"' : ''); - var strDefine = 'define("' + moduleId + '", [' + strDeps + '], ' + factory + ');'; - return { - path: path, - contents: contents + '\n;\n' + strDefine - }; -} -/** - * Convert a position (line:col) to (offset) in string `str` - */ -function positionToOffset(str, desiredLine, desiredCol) { - if (desiredLine === 1) { - return desiredCol - 1; - } - var line = 1, lastNewLineOffset = -1; - do { - if (desiredLine === line) { - return lastNewLineOffset + 1 + desiredCol - 1; - } - lastNewLineOffset = str.indexOf('\n', lastNewLineOffset + 1); - line++; - } while (lastNewLineOffset >= 0); - return -1; -} -/** - * Return a set of reachable nodes in `graph` starting from `rootNodes` - */ -function visit(rootNodes, graph) { - var result = {}, queue = rootNodes; - rootNodes.forEach(function (node) { - result[node] = true; - }); - while (queue.length > 0) { - var el = queue.shift(); - var myEdges = graph[el] || []; - myEdges.forEach(function (toNode) { - if (!result[toNode]) { - result[toNode] = true; - queue.push(toNode); - } - }); - } - return result; -} -/** - * Perform a topological sort on `graph` - */ -function topologicalSort(graph) { - var allNodes = {}, outgoingEdgeCount = {}, inverseEdges = {}; - Object.keys(graph).forEach(function (fromNode) { - allNodes[fromNode] = true; - outgoingEdgeCount[fromNode] = graph[fromNode].length; - graph[fromNode].forEach(function (toNode) { - allNodes[toNode] = true; - outgoingEdgeCount[toNode] = outgoingEdgeCount[toNode] || 0; - inverseEdges[toNode] = inverseEdges[toNode] || []; - inverseEdges[toNode].push(fromNode); - }); - }); - // https://en.wikipedia.org/wiki/Topological_sorting - var S = [], L = []; - Object.keys(allNodes).forEach(function (node) { - if (outgoingEdgeCount[node] === 0) { - delete outgoingEdgeCount[node]; - S.push(node); - } - }); - while (S.length > 0) { - // Ensure the exact same order all the time with the same inputs - S.sort(); - var n = S.shift(); - L.push(n); - var myInverseEdges = inverseEdges[n] || []; - myInverseEdges.forEach(function (m) { - outgoingEdgeCount[m]--; - if (outgoingEdgeCount[m] === 0) { - delete outgoingEdgeCount[m]; - S.push(m); - } - }); - } - if (Object.keys(outgoingEdgeCount).length > 0) { - throw new Error('Cannot do topological sort on cyclic graph, remaining nodes: ' + Object.keys(outgoingEdgeCount)); - } - return L; -} +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +var fs = require("fs"); +var path = require("path"); +var vm = require("vm"); +/** + * Bundle `entryPoints` given config `config`. + */ +function bundle(entryPoints, config, callback) { + var entryPointsMap = {}; + entryPoints.forEach(function (module) { + entryPointsMap[module.name] = module; + }); + var allMentionedModulesMap = {}; + entryPoints.forEach(function (module) { + allMentionedModulesMap[module.name] = true; + (module.include || []).forEach(function (includedModule) { + allMentionedModulesMap[includedModule] = true; + }); + (module.exclude || []).forEach(function (excludedModule) { + allMentionedModulesMap[excludedModule] = true; + }); + }); + var code = require('fs').readFileSync(path.join(__dirname, '../../src/vs/loader.js')); + var r = vm.runInThisContext('(function(require, module, exports) { ' + code + '\n});'); + var loaderModule = { exports: {} }; + r.call({}, require, loaderModule, loaderModule.exports); + var loader = loaderModule.exports; + config.isBuild = true; + loader.config(config); + loader(['require'], function (localRequire) { + var resolvePath = function (path) { + var r = localRequire.toUrl(path); + if (!/\.js/.test(r)) { + return r + '.js'; + } + return r; + }; + for (var moduleId in entryPointsMap) { + var entryPoint = entryPointsMap[moduleId]; + if (entryPoint.append) { + entryPoint.append = entryPoint.append.map(resolvePath); + } + if (entryPoint.prepend) { + entryPoint.prepend = entryPoint.prepend.map(resolvePath); + } + } + }); + loader(Object.keys(allMentionedModulesMap), function () { + var modules = loader.getBuildInfo(); + var partialResult = emitEntryPoints(modules, entryPointsMap); + var cssInlinedResources = loader('vs/css').getInlinedResources(); + callback(null, { + files: partialResult.files, + cssInlinedResources: cssInlinedResources, + bundleData: partialResult.bundleData + }); + }, function (err) { return callback(err, null); }); +} +exports.bundle = bundle; +function emitEntryPoints(modules, entryPoints) { + var modulesMap = {}; + modules.forEach(function (m) { + modulesMap[m.id] = m; + }); + var modulesGraph = {}; + modules.forEach(function (m) { + modulesGraph[m.id] = m.dependencies; + }); + var sortedModules = topologicalSort(modulesGraph); + var result = []; + var usedPlugins = {}; + var bundleData = { + graph: modulesGraph, + bundles: {} + }; + Object.keys(entryPoints).forEach(function (moduleToBundle) { + var info = entryPoints[moduleToBundle]; + var rootNodes = [moduleToBundle].concat(info.include || []); + var allDependencies = visit(rootNodes, modulesGraph); + var excludes = ['require', 'exports', 'module'].concat(info.exclude || []); + excludes.forEach(function (excludeRoot) { + var allExcludes = visit([excludeRoot], modulesGraph); + Object.keys(allExcludes).forEach(function (exclude) { + delete allDependencies[exclude]; + }); + }); + var includedModules = sortedModules.filter(function (module) { + return allDependencies[module]; + }); + bundleData.bundles[moduleToBundle] = includedModules; + var res = emitEntryPoint(modulesMap, modulesGraph, moduleToBundle, includedModules, info.prepend, info.append, info.dest); + result = result.concat(res.files); + for (var pluginName in res.usedPlugins) { + usedPlugins[pluginName] = usedPlugins[pluginName] || res.usedPlugins[pluginName]; + } + }); + Object.keys(usedPlugins).forEach(function (pluginName) { + var plugin = usedPlugins[pluginName]; + if (typeof plugin.finishBuild === 'function') { + var write = function (filename, contents) { + result.push({ + dest: filename, + sources: [{ + path: null, + contents: contents + }] + }); + }; + plugin.finishBuild(write); + } + }); + return { + // TODO@TS 2.1.2 + files: extractStrings(removeDuplicateTSBoilerplate(result)), + bundleData: bundleData + }; +} +function extractStrings(destFiles) { + var parseDefineCall = function (moduleMatch, depsMatch) { + var module = moduleMatch.replace(/^"|"$/g, ''); + var deps = depsMatch.split(','); + deps = deps.map(function (dep) { + dep = dep.trim(); + dep = dep.replace(/^"|"$/g, ''); + dep = dep.replace(/^'|'$/g, ''); + var prefix = null; + var _path = null; + var pieces = dep.split('!'); + if (pieces.length > 1) { + prefix = pieces[0] + '!'; + _path = pieces[1]; + } + else { + prefix = ''; + _path = pieces[0]; + } + if (/^\.\//.test(_path) || /^\.\.\//.test(_path)) { + var res = path.join(path.dirname(module), _path).replace(/\\/g, '/'); + return prefix + res; + } + return prefix + _path; + }); + return { + module: module, + deps: deps + }; + }; + destFiles.forEach(function (destFile, index) { + if (!/\.js$/.test(destFile.dest)) { + return; + } + if (/\.nls\.js$/.test(destFile.dest)) { + return; + } + // Do one pass to record the usage counts for each module id + var useCounts = {}; + destFile.sources.forEach(function (source) { + var matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/); + if (!matches) { + return; + } + var defineCall = parseDefineCall(matches[1], matches[2]); + useCounts[defineCall.module] = (useCounts[defineCall.module] || 0) + 1; + defineCall.deps.forEach(function (dep) { + useCounts[dep] = (useCounts[dep] || 0) + 1; + }); + }); + var sortedByUseModules = Object.keys(useCounts); + sortedByUseModules.sort(function (a, b) { + return useCounts[b] - useCounts[a]; + }); + var replacementMap = {}; + sortedByUseModules.forEach(function (module, index) { + replacementMap[module] = index; + }); + destFile.sources.forEach(function (source) { + source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, function (_, moduleMatch, depsMatch) { + var defineCall = parseDefineCall(moduleMatch, depsMatch); + return "define(__m[" + replacementMap[defineCall.module] + "/*" + defineCall.module + "*/], __M([" + defineCall.deps.map(function (dep) { return replacementMap[dep] + '/*' + dep + '*/'; }).join(',') + "])"; + }); + }); + destFile.sources.unshift({ + path: null, + contents: [ + '(function() {', + "var __m = " + JSON.stringify(sortedByUseModules) + ";", + "var __M = function(deps) {", + " var result = [];", + " for (var i = 0, len = deps.length; i < len; i++) {", + " result[i] = __m[deps[i]];", + " }", + " return result;", + "};" + ].join('\n') + }); + destFile.sources.push({ + path: null, + contents: '}).call(this);' + }); + }); + return destFiles; +} +function removeDuplicateTSBoilerplate(destFiles) { + // Taken from typescript compiler => emitFiles + var BOILERPLATE = [ + { start: /^var __extends/, end: /^}\)\(\);$/ }, + { start: /^var __assign/, end: /^};$/ }, + { start: /^var __decorate/, end: /^};$/ }, + { start: /^var __metadata/, end: /^};$/ }, + { start: /^var __param/, end: /^};$/ }, + { start: /^var __awaiter/, end: /^};$/ }, + ]; + destFiles.forEach(function (destFile) { + var SEEN_BOILERPLATE = []; + destFile.sources.forEach(function (source) { + var lines = source.contents.split(/\r\n|\n|\r/); + var newLines = []; + var IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE; + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + if (IS_REMOVING_BOILERPLATE) { + newLines.push(''); + if (END_BOILERPLATE.test(line)) { + IS_REMOVING_BOILERPLATE = false; + } + } + else { + for (var j = 0; j < BOILERPLATE.length; j++) { + var boilerplate = BOILERPLATE[j]; + if (boilerplate.start.test(line)) { + if (SEEN_BOILERPLATE[j]) { + IS_REMOVING_BOILERPLATE = true; + END_BOILERPLATE = boilerplate.end; + } + else { + SEEN_BOILERPLATE[j] = true; + } + } + } + if (IS_REMOVING_BOILERPLATE) { + newLines.push(''); + } + else { + newLines.push(line); + } + } + } + source.contents = newLines.join('\n'); + }); + }); + return destFiles; +} +function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend, append, dest) { + if (!dest) { + dest = entryPoint + '.js'; + } + var mainResult = { + sources: [], + dest: dest + }, results = [mainResult]; + var usedPlugins = {}; + var getLoaderPlugin = function (pluginName) { + if (!usedPlugins[pluginName]) { + usedPlugins[pluginName] = modulesMap[pluginName].exports; + } + return usedPlugins[pluginName]; + }; + includedModules.forEach(function (c) { + var bangIndex = c.indexOf('!'); + if (bangIndex >= 0) { + var pluginName = c.substr(0, bangIndex); + var plugin = getLoaderPlugin(pluginName); + mainResult.sources.push(emitPlugin(entryPoint, plugin, pluginName, c.substr(bangIndex + 1))); + return; + } + var module = modulesMap[c]; + if (module.path === 'empty:') { + return; + } + var contents = readFileAndRemoveBOM(module.path); + if (module.shim) { + mainResult.sources.push(emitShimmedModule(c, deps[c], module.shim, module.path, contents)); + } + else { + mainResult.sources.push(emitNamedModule(c, deps[c], module.defineLocation, module.path, contents)); + } + }); + Object.keys(usedPlugins).forEach(function (pluginName) { + var plugin = usedPlugins[pluginName]; + if (typeof plugin.writeFile === 'function') { + var req = (function () { + throw new Error('no-no!'); + }); + req.toUrl = function (something) { return something; }; + var write = function (filename, contents) { + results.push({ + dest: filename, + sources: [{ + path: null, + contents: contents + }] + }); + }; + plugin.writeFile(pluginName, entryPoint, req, write, {}); + } + }); + var toIFile = function (path) { + var contents = readFileAndRemoveBOM(path); + return { + path: path, + contents: contents + }; + }; + var toPrepend = (prepend || []).map(toIFile); + var toAppend = (append || []).map(toIFile); + mainResult.sources = toPrepend.concat(mainResult.sources).concat(toAppend); + return { + files: results, + usedPlugins: usedPlugins + }; +} +function readFileAndRemoveBOM(path) { + var BOM_CHAR_CODE = 65279; + var contents = fs.readFileSync(path, 'utf8'); + // Remove BOM + if (contents.charCodeAt(0) === BOM_CHAR_CODE) { + contents = contents.substring(1); + } + return contents; +} +function emitPlugin(entryPoint, plugin, pluginName, moduleName) { + var result = ''; + if (typeof plugin.write === 'function') { + var write = (function (what) { + result += what; + }); + write.getEntryPoint = function () { + return entryPoint; + }; + write.asModule = function (moduleId, code) { + code = code.replace(/^define\(/, 'define("' + moduleId + '",'); + result += code; + }; + plugin.write(pluginName, moduleName, write); + } + return { + path: null, + contents: result + }; +} +function emitNamedModule(moduleId, myDeps, defineCallPosition, path, contents) { + // `defineCallPosition` is the position in code: |define() + var defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col); + // `parensOffset` is the position in code: define|() + var parensOffset = contents.indexOf('(', defineCallOffset); + var insertStr = '"' + moduleId + '", '; + return { + path: path, + contents: contents.substr(0, parensOffset + 1) + insertStr + contents.substr(parensOffset + 1) + }; +} +function emitShimmedModule(moduleId, myDeps, factory, path, contents) { + var strDeps = (myDeps.length > 0 ? '"' + myDeps.join('", "') + '"' : ''); + var strDefine = 'define("' + moduleId + '", [' + strDeps + '], ' + factory + ');'; + return { + path: path, + contents: contents + '\n;\n' + strDefine + }; +} +/** + * Convert a position (line:col) to (offset) in string `str` + */ +function positionToOffset(str, desiredLine, desiredCol) { + if (desiredLine === 1) { + return desiredCol - 1; + } + var line = 1, lastNewLineOffset = -1; + do { + if (desiredLine === line) { + return lastNewLineOffset + 1 + desiredCol - 1; + } + lastNewLineOffset = str.indexOf('\n', lastNewLineOffset + 1); + line++; + } while (lastNewLineOffset >= 0); + return -1; +} +/** + * Return a set of reachable nodes in `graph` starting from `rootNodes` + */ +function visit(rootNodes, graph) { + var result = {}, queue = rootNodes; + rootNodes.forEach(function (node) { + result[node] = true; + }); + while (queue.length > 0) { + var el = queue.shift(); + var myEdges = graph[el] || []; + myEdges.forEach(function (toNode) { + if (!result[toNode]) { + result[toNode] = true; + queue.push(toNode); + } + }); + } + return result; +} +/** + * Perform a topological sort on `graph` + */ +function topologicalSort(graph) { + var allNodes = {}, outgoingEdgeCount = {}, inverseEdges = {}; + Object.keys(graph).forEach(function (fromNode) { + allNodes[fromNode] = true; + outgoingEdgeCount[fromNode] = graph[fromNode].length; + graph[fromNode].forEach(function (toNode) { + allNodes[toNode] = true; + outgoingEdgeCount[toNode] = outgoingEdgeCount[toNode] || 0; + inverseEdges[toNode] = inverseEdges[toNode] || []; + inverseEdges[toNode].push(fromNode); + }); + }); + // https://en.wikipedia.org/wiki/Topological_sorting + var S = [], L = []; + Object.keys(allNodes).forEach(function (node) { + if (outgoingEdgeCount[node] === 0) { + delete outgoingEdgeCount[node]; + S.push(node); + } + }); + while (S.length > 0) { + // Ensure the exact same order all the time with the same inputs + S.sort(); + var n = S.shift(); + L.push(n); + var myInverseEdges = inverseEdges[n] || []; + myInverseEdges.forEach(function (m) { + outgoingEdgeCount[m]--; + if (outgoingEdgeCount[m] === 0) { + delete outgoingEdgeCount[m]; + S.push(m); + } + }); + } + if (Object.keys(outgoingEdgeCount).length > 0) { + throw new Error('Cannot do topological sort on cyclic graph, remaining nodes: ' + Object.keys(outgoingEdgeCount)); + } + return L; +} diff --git a/build/lib/compilation.js b/build/lib/compilation.js index e49862b4778..d9691ebc1d2 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -1,171 +1,171 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -var gulp = require("gulp"); -var tsb = require("gulp-tsb"); -var es = require("event-stream"); -var watch = require('./watch'); -var nls = require("./nls"); -var util = require("./util"); -var reporter_1 = require("./reporter"); -var path = require("path"); -var bom = require("gulp-bom"); -var sourcemaps = require("gulp-sourcemaps"); -var _ = require("underscore"); -var monacodts = require("../monaco/api"); -var fs = require("fs"); -var reporter = reporter_1.createReporter(); -var rootDir = path.join(__dirname, '../../src'); -var options = require('../../src/tsconfig.json').compilerOptions; -options.verbose = false; -options.sourceMap = true; -options.rootDir = rootDir; -options.sourceRoot = util.toFileUri(rootDir); -function createCompile(build, emitError) { - var opts = _.clone(options); - opts.inlineSources = !!build; - opts.noFilesystemLookup = true; - var ts = tsb.create(opts, null, null, function (err) { return reporter(err.toString()); }); - return function (token) { - var utf8Filter = util.filter(function (data) { return /(\/|\\)test(\/|\\).*utf8/.test(data.path); }); - var tsFilter = util.filter(function (data) { return /\.ts$/.test(data.path); }); - var noDeclarationsFilter = util.filter(function (data) { return !(/\.d\.ts$/.test(data.path)); }); - var input = es.through(); - var output = input - .pipe(utf8Filter) - .pipe(bom()) - .pipe(utf8Filter.restore) - .pipe(tsFilter) - .pipe(util.loadSourcemaps()) - .pipe(ts(token)) - .pipe(build ? reloadTypeScriptNodeModule() : es.through()) - .pipe(noDeclarationsFilter) - .pipe(build ? nls() : es.through()) - .pipe(noDeclarationsFilter.restore) - .pipe(sourcemaps.write('.', { - addComment: false, - includeContent: !!build, - sourceRoot: options.sourceRoot - })) - .pipe(tsFilter.restore) - .pipe(reporter.end(emitError)); - return es.duplex(input, output); - }; -} -function compileTask(out, build) { - return function () { - var compile = createCompile(build, true); - var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); - return src - .pipe(compile()) - .pipe(gulp.dest(out)) - .pipe(monacodtsTask(out, false)); - }; -} -exports.compileTask = compileTask; -function watchTask(out, build) { - return function () { - var compile = createCompile(build); - var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); - var watchSrc = watch('src/**', { base: 'src' }); - return watchSrc - .pipe(util.incremental(compile, src, true)) - .pipe(gulp.dest(out)) - .pipe(monacodtsTask(out, true)); - }; -} -exports.watchTask = watchTask; -function reloadTypeScriptNodeModule() { - var util = require('gulp-util'); - function log(message) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - util.log.apply(util, [util.colors.cyan('[memory watch dog]'), message].concat(rest)); - } - function heapUsed() { - return (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + ' MB'; - } - return es.through(function (data) { - this.emit('data', data); - }, function () { - log('memory usage after compilation finished: ' + heapUsed()); - // It appears we are running into some variant of - // https://bugs.chromium.org/p/v8/issues/detail?id=2073 - // - // Even though all references are dropped, some - // optimized methods in the TS compiler end up holding references - // to the entire TypeScript language host (>600MB) - // - // The idea is to force v8 to drop references to these - // optimized methods, by "reloading" the typescript node module - log('Reloading typescript node module...'); - var resolvedName = require.resolve('typescript'); - var originalModule = require.cache[resolvedName]; - delete require.cache[resolvedName]; - var newExports = require('typescript'); - require.cache[resolvedName] = originalModule; - for (var prop in newExports) { - if (newExports.hasOwnProperty(prop)) { - originalModule.exports[prop] = newExports[prop]; - } - } - log('typescript node module reloaded.'); - this.emit('end'); - }); -} -function monacodtsTask(out, isWatch) { - var neededFiles = {}; - monacodts.getFilesToWatch(out).forEach(function (filePath) { - filePath = path.normalize(filePath); - neededFiles[filePath] = true; - }); - var inputFiles = {}; - for (var filePath in neededFiles) { - if (/\bsrc(\/|\\)vs\b/.test(filePath)) { - // This file is needed from source => simply read it now - inputFiles[filePath] = fs.readFileSync(filePath).toString(); - } - } - var setInputFile = function (filePath, contents) { - if (inputFiles[filePath] === contents) { - // no change - return; - } - inputFiles[filePath] = contents; - var neededInputFilesCount = Object.keys(neededFiles).length; - var availableInputFilesCount = Object.keys(inputFiles).length; - if (neededInputFilesCount === availableInputFilesCount) { - run(); - } - }; - var run = function () { - var result = monacodts.run(out, inputFiles); - if (!result.isTheSame) { - if (isWatch) { - fs.writeFileSync(result.filePath, result.content); - } - else { - resultStream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.'); - } - } - }; - var resultStream; - if (isWatch) { - watch('build/monaco/*').pipe(es.through(function () { - run(); - })); - } - resultStream = es.through(function (data) { - var filePath = path.normalize(data.path); - if (neededFiles[filePath]) { - setInputFile(filePath, data.contents.toString()); - } - this.emit('data', data); - }); - return resultStream; -} +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +var gulp = require("gulp"); +var tsb = require("gulp-tsb"); +var es = require("event-stream"); +var watch = require('./watch'); +var nls = require("./nls"); +var util = require("./util"); +var reporter_1 = require("./reporter"); +var path = require("path"); +var bom = require("gulp-bom"); +var sourcemaps = require("gulp-sourcemaps"); +var _ = require("underscore"); +var monacodts = require("../monaco/api"); +var fs = require("fs"); +var reporter = reporter_1.createReporter(); +var rootDir = path.join(__dirname, '../../src'); +var options = require('../../src/tsconfig.json').compilerOptions; +options.verbose = false; +options.sourceMap = true; +options.rootDir = rootDir; +options.sourceRoot = util.toFileUri(rootDir); +function createCompile(build, emitError) { + var opts = _.clone(options); + opts.inlineSources = !!build; + opts.noFilesystemLookup = true; + var ts = tsb.create(opts, null, null, function (err) { return reporter(err.toString()); }); + return function (token) { + var utf8Filter = util.filter(function (data) { return /(\/|\\)test(\/|\\).*utf8/.test(data.path); }); + var tsFilter = util.filter(function (data) { return /\.ts$/.test(data.path); }); + var noDeclarationsFilter = util.filter(function (data) { return !(/\.d\.ts$/.test(data.path)); }); + var input = es.through(); + var output = input + .pipe(utf8Filter) + .pipe(bom()) + .pipe(utf8Filter.restore) + .pipe(tsFilter) + .pipe(util.loadSourcemaps()) + .pipe(ts(token)) + .pipe(build ? reloadTypeScriptNodeModule() : es.through()) + .pipe(noDeclarationsFilter) + .pipe(build ? nls() : es.through()) + .pipe(noDeclarationsFilter.restore) + .pipe(sourcemaps.write('.', { + addComment: false, + includeContent: !!build, + sourceRoot: options.sourceRoot + })) + .pipe(tsFilter.restore) + .pipe(reporter.end(emitError)); + return es.duplex(input, output); + }; +} +function compileTask(out, build) { + return function () { + var compile = createCompile(build, true); + var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); + return src + .pipe(compile()) + .pipe(gulp.dest(out)) + .pipe(monacodtsTask(out, false)); + }; +} +exports.compileTask = compileTask; +function watchTask(out, build) { + return function () { + var compile = createCompile(build); + var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); + var watchSrc = watch('src/**', { base: 'src' }); + return watchSrc + .pipe(util.incremental(compile, src, true)) + .pipe(gulp.dest(out)) + .pipe(monacodtsTask(out, true)); + }; +} +exports.watchTask = watchTask; +function reloadTypeScriptNodeModule() { + var util = require('gulp-util'); + function log(message) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + util.log.apply(util, [util.colors.cyan('[memory watch dog]'), message].concat(rest)); + } + function heapUsed() { + return (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + ' MB'; + } + return es.through(function (data) { + this.emit('data', data); + }, function () { + log('memory usage after compilation finished: ' + heapUsed()); + // It appears we are running into some variant of + // https://bugs.chromium.org/p/v8/issues/detail?id=2073 + // + // Even though all references are dropped, some + // optimized methods in the TS compiler end up holding references + // to the entire TypeScript language host (>600MB) + // + // The idea is to force v8 to drop references to these + // optimized methods, by "reloading" the typescript node module + log('Reloading typescript node module...'); + var resolvedName = require.resolve('typescript'); + var originalModule = require.cache[resolvedName]; + delete require.cache[resolvedName]; + var newExports = require('typescript'); + require.cache[resolvedName] = originalModule; + for (var prop in newExports) { + if (newExports.hasOwnProperty(prop)) { + originalModule.exports[prop] = newExports[prop]; + } + } + log('typescript node module reloaded.'); + this.emit('end'); + }); +} +function monacodtsTask(out, isWatch) { + var neededFiles = {}; + monacodts.getFilesToWatch(out).forEach(function (filePath) { + filePath = path.normalize(filePath); + neededFiles[filePath] = true; + }); + var inputFiles = {}; + for (var filePath in neededFiles) { + if (/\bsrc(\/|\\)vs\b/.test(filePath)) { + // This file is needed from source => simply read it now + inputFiles[filePath] = fs.readFileSync(filePath).toString(); + } + } + var setInputFile = function (filePath, contents) { + if (inputFiles[filePath] === contents) { + // no change + return; + } + inputFiles[filePath] = contents; + var neededInputFilesCount = Object.keys(neededFiles).length; + var availableInputFilesCount = Object.keys(inputFiles).length; + if (neededInputFilesCount === availableInputFilesCount) { + run(); + } + }; + var run = function () { + var result = monacodts.run(out, inputFiles); + if (!result.isTheSame) { + if (isWatch) { + fs.writeFileSync(result.filePath, result.content); + } + else { + resultStream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.'); + } + } + }; + var resultStream; + if (isWatch) { + watch('build/monaco/*').pipe(es.through(function () { + run(); + })); + } + resultStream = es.through(function (data) { + var filePath = path.normalize(data.path); + if (neededFiles[filePath]) { + setInputFile(filePath, data.contents.toString()); + } + this.emit('data', data); + }); + return resultStream; +} diff --git a/build/lib/extensions.js b/build/lib/extensions.js index e0a0d727883..b1b354abcff 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -1,96 +1,96 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var event_stream_1 = require("event-stream"); -var assign = require("object-assign"); -var remote = require("gulp-remote-src"); -var flatmap = require('gulp-flatmap'); -var vzip = require('gulp-vinyl-zip'); -var filter = require('gulp-filter'); -var rename = require('gulp-rename'); -var util = require('gulp-util'); -var buffer = require('gulp-buffer'); -var json = require('gulp-json-editor'); -function error(err) { - var result = event_stream_1.through(); - setTimeout(function () { return result.emit('error', err); }); - return result; -} -var baseHeaders = { - 'X-Market-Client-Id': 'VSCode Build', - 'User-Agent': 'VSCode Build', -}; -function src(extensionName, version) { - var filterType = 7; - var value = extensionName; - var criterium = { filterType: filterType, value: value }; - var criteria = [criterium]; - var pageNumber = 1; - var pageSize = 1; - var sortBy = 0; - var sortOrder = 0; - var flags = 0x1 | 0x2 | 0x80; - var assetTypes = ['Microsoft.VisualStudio.Services.VSIXPackage']; - var filters = [{ criteria: criteria, pageNumber: pageNumber, pageSize: pageSize, sortBy: sortBy, sortOrder: sortOrder }]; - var body = JSON.stringify({ filters: filters, assetTypes: assetTypes, flags: flags }); - var headers = assign({}, baseHeaders, { - 'Content-Type': 'application/json', - 'Accept': 'application/json;api-version=3.0-preview.1', - 'Content-Length': body.length - }); - var options = { - base: 'https://marketplace.visualstudio.com/_apis/public/gallery', - requestOptions: { - method: 'POST', - gzip: true, - headers: headers, - body: body - } - }; - return remote('/extensionquery', options) - .pipe(flatmap(function (stream, f) { - var rawResult = f.contents.toString('utf8'); - var result = JSON.parse(rawResult); - var extension = result.results[0].extensions[0]; - if (!extension) { - return error("No such extension: " + extension); - } - var metadata = { - id: extension.extensionId, - publisherId: extension.publisher, - publisherDisplayName: extension.publisher.displayName - }; - var extensionVersion = extension.versions.filter(function (v) { return v.version === version; })[0]; - if (!extensionVersion) { - return error("No such extension version: " + extensionName + " @ " + version); - } - var asset = extensionVersion.files.filter(function (f) { return f.assetType === 'Microsoft.VisualStudio.Services.VSIXPackage'; })[0]; - if (!asset) { - return error("No VSIX found for extension version: " + extensionName + " @ " + version); - } - util.log('Downloading extension:', util.colors.yellow(extensionName + "@" + version), '...'); - var options = { - base: asset.source, - requestOptions: { - gzip: true, - headers: baseHeaders - } - }; - return remote('', options) - .pipe(flatmap(function (stream) { - var packageJsonFilter = filter('package.json', { restore: true }); - return stream - .pipe(vzip.src()) - .pipe(filter('extension/**')) - .pipe(rename(function (p) { return p.dirname = p.dirname.replace(/^extension\/?/, ''); })) - .pipe(packageJsonFilter) - .pipe(buffer()) - .pipe(json({ __metadata: metadata })) - .pipe(packageJsonFilter.restore); - })); - })); -} -exports.src = src; +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +var event_stream_1 = require("event-stream"); +var assign = require("object-assign"); +var remote = require("gulp-remote-src"); +var flatmap = require('gulp-flatmap'); +var vzip = require('gulp-vinyl-zip'); +var filter = require('gulp-filter'); +var rename = require('gulp-rename'); +var util = require('gulp-util'); +var buffer = require('gulp-buffer'); +var json = require('gulp-json-editor'); +function error(err) { + var result = event_stream_1.through(); + setTimeout(function () { return result.emit('error', err); }); + return result; +} +var baseHeaders = { + 'X-Market-Client-Id': 'VSCode Build', + 'User-Agent': 'VSCode Build', +}; +function src(extensionName, version) { + var filterType = 7; + var value = extensionName; + var criterium = { filterType: filterType, value: value }; + var criteria = [criterium]; + var pageNumber = 1; + var pageSize = 1; + var sortBy = 0; + var sortOrder = 0; + var flags = 0x1 | 0x2 | 0x80; + var assetTypes = ['Microsoft.VisualStudio.Services.VSIXPackage']; + var filters = [{ criteria: criteria, pageNumber: pageNumber, pageSize: pageSize, sortBy: sortBy, sortOrder: sortOrder }]; + var body = JSON.stringify({ filters: filters, assetTypes: assetTypes, flags: flags }); + var headers = assign({}, baseHeaders, { + 'Content-Type': 'application/json', + 'Accept': 'application/json;api-version=3.0-preview.1', + 'Content-Length': body.length + }); + var options = { + base: 'https://marketplace.visualstudio.com/_apis/public/gallery', + requestOptions: { + method: 'POST', + gzip: true, + headers: headers, + body: body + } + }; + return remote('/extensionquery', options) + .pipe(flatmap(function (stream, f) { + var rawResult = f.contents.toString('utf8'); + var result = JSON.parse(rawResult); + var extension = result.results[0].extensions[0]; + if (!extension) { + return error("No such extension: " + extension); + } + var metadata = { + id: extension.extensionId, + publisherId: extension.publisher, + publisherDisplayName: extension.publisher.displayName + }; + var extensionVersion = extension.versions.filter(function (v) { return v.version === version; })[0]; + if (!extensionVersion) { + return error("No such extension version: " + extensionName + " @ " + version); + } + var asset = extensionVersion.files.filter(function (f) { return f.assetType === 'Microsoft.VisualStudio.Services.VSIXPackage'; })[0]; + if (!asset) { + return error("No VSIX found for extension version: " + extensionName + " @ " + version); + } + util.log('Downloading extension:', util.colors.yellow(extensionName + "@" + version), '...'); + var options = { + base: asset.source, + requestOptions: { + gzip: true, + headers: baseHeaders + } + }; + return remote('', options) + .pipe(flatmap(function (stream) { + var packageJsonFilter = filter('package.json', { restore: true }); + return stream + .pipe(vzip.src()) + .pipe(filter('extension/**')) + .pipe(rename(function (p) { return p.dirname = p.dirname.replace(/^extension\/?/, ''); })) + .pipe(packageJsonFilter) + .pipe(buffer()) + .pipe(json({ __metadata: metadata })) + .pipe(packageJsonFilter.restore); + })); + })); +} +exports.src = src; diff --git a/build/lib/git.js b/build/lib/git.js index 8b31b9a2e0f..e9a571b7c9b 100644 --- a/build/lib/git.js +++ b/build/lib/git.js @@ -1,53 +1,53 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -var path = require("path"); -var fs = require("fs"); -/** - * Returns the sha1 commit version of a repository or undefined in case of failure. - */ -function getVersion(repo) { - var git = path.join(repo, '.git'); - var headPath = path.join(git, 'HEAD'); - var head; - try { - head = fs.readFileSync(headPath, 'utf8').trim(); - } - catch (e) { - return void 0; - } - if (/^[0-9a-f]{40}$/i.test(head)) { - return head; - } - var refMatch = /^ref: (.*)$/.exec(head); - if (!refMatch) { - return void 0; - } - var ref = refMatch[1]; - var refPath = path.join(git, ref); - try { - return fs.readFileSync(refPath, 'utf8').trim(); - } - catch (e) { - // noop - } - var packedRefsPath = path.join(git, 'packed-refs'); - var refsRaw; - try { - refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim(); - } - catch (e) { - return void 0; - } - var refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm; - var refsMatch; - var refs = {}; - while (refsMatch = refsRegex.exec(refsRaw)) { - refs[refsMatch[2]] = refsMatch[1]; - } - return refs[ref]; -} -exports.getVersion = getVersion; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var fs = require("fs"); +/** + * Returns the sha1 commit version of a repository or undefined in case of failure. + */ +function getVersion(repo) { + var git = path.join(repo, '.git'); + var headPath = path.join(git, 'HEAD'); + var head; + try { + head = fs.readFileSync(headPath, 'utf8').trim(); + } + catch (e) { + return void 0; + } + if (/^[0-9a-f]{40}$/i.test(head)) { + return head; + } + var refMatch = /^ref: (.*)$/.exec(head); + if (!refMatch) { + return void 0; + } + var ref = refMatch[1]; + var refPath = path.join(git, ref); + try { + return fs.readFileSync(refPath, 'utf8').trim(); + } + catch (e) { + // noop + } + var packedRefsPath = path.join(git, 'packed-refs'); + var refsRaw; + try { + refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim(); + } + catch (e) { + return void 0; + } + var refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm; + var refsMatch; + var refs = {}; + while (refsMatch = refsRegex.exec(refsRaw)) { + refs[refsMatch[2]] = refsMatch[1]; + } + return refs[ref]; +} +exports.getVersion = getVersion; diff --git a/build/lib/i18n.js b/build/lib/i18n.js index e0bfbe4b987..433e1956fa8 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -1,1049 +1,1048 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var path = require("path"); -var fs = require("fs"); -var event_stream_1 = require("event-stream"); -var File = require("vinyl"); -var Is = require("is"); -var xml2js = require("xml2js"); -var glob = require("glob"); -var http = require("http"); -var util = require('gulp-util'); -var iconv = require('iconv-lite'); -function log(message) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - util.log.apply(util, [util.colors.green('[i18n]'), message].concat(rest)); -} -var LocalizeInfo; -(function (LocalizeInfo) { - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.key) && (Is.undef(candidate.comment) || (Is.array(candidate.comment) && candidate.comment.every(function (element) { return Is.string(element); }))); - } - LocalizeInfo.is = is; -})(LocalizeInfo || (LocalizeInfo = {})); -var BundledFormat; -(function (BundledFormat) { - function is(value) { - if (Is.undef(value)) { - return false; - } - var candidate = value; - var length = Object.keys(value).length; - return length === 3 && Is.defined(candidate.keys) && Is.defined(candidate.messages) && Is.defined(candidate.bundles); - } - BundledFormat.is = is; -})(BundledFormat || (BundledFormat = {})); -var PackageJsonFormat; -(function (PackageJsonFormat) { - function is(value) { - if (Is.undef(value) || !Is.object(value)) { - return false; - } - return Object.keys(value).every(function (key) { - var element = value[key]; - return Is.string(element) || (Is.object(element) && Is.defined(element.message) && Is.defined(element.comment)); - }); - } - PackageJsonFormat.is = is; -})(PackageJsonFormat || (PackageJsonFormat = {})); -var ModuleJsonFormat; -(function (ModuleJsonFormat) { - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Is.array(candidate.messages) && candidate.messages.every(function (message) { return Is.string(message); }) - && Is.array(candidate.keys) && candidate.keys.every(function (key) { return Is.string(key) || LocalizeInfo.is(key); }); - } - ModuleJsonFormat.is = is; -})(ModuleJsonFormat || (ModuleJsonFormat = {})); -var Line = (function () { - function Line(indent) { - if (indent === void 0) { indent = 0; } - this.indent = indent; - this.buffer = []; - if (indent > 0) { - this.buffer.push(new Array(indent + 1).join(' ')); - } - } - Line.prototype.append = function (value) { - this.buffer.push(value); - return this; - }; - Line.prototype.toString = function () { - return this.buffer.join(''); - }; - return Line; -}()); -exports.Line = Line; -var TextModel = (function () { - function TextModel(contents) { - this._lines = contents.split(/\r\n|\r|\n/); - } - Object.defineProperty(TextModel.prototype, "lines", { - get: function () { - return this._lines; - }, - enumerable: true, - configurable: true - }); - return TextModel; -}()); -var XLF = (function () { - function XLF(project) { - this.project = project; - this.buffer = []; - this.files = Object.create(null); - } - XLF.prototype.toString = function () { - this.appendHeader(); - for (var file in this.files) { - this.appendNewLine("", 2); - for (var _i = 0, _a = this.files[file]; _i < _a.length; _i++) { - var item = _a[_i]; - this.addStringItem(item); - } - this.appendNewLine('', 2); - } - this.appendFooter(); - return this.buffer.join('\r\n'); - }; - XLF.prototype.addFile = function (original, keys, messages) { - this.files[original] = []; - var existingKeys = []; - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - // Ignore duplicate keys because Transifex does not populate those with translated values. - if (existingKeys.indexOf(key) !== -1) { - continue; - } - existingKeys.push(key); - var message = encodeEntities(messages[keys.indexOf(key)]); - var comment = undefined; - // Check if the message contains description (if so, it becomes an object type in JSON) - if (Is.string(key)) { - this.files[original].push({ id: key, message: message, comment: comment }); - } - else { - if (key['comment'] && key['comment'].length > 0) { - comment = key['comment'].map(function (comment) { return encodeEntities(comment); }).join('\r\n'); - } - this.files[original].push({ id: key['key'], message: message, comment: comment }); - } - } - }; - XLF.prototype.addStringItem = function (item) { - if (!item.id || !item.message) { - throw new Error('No item ID or value specified.'); - } - this.appendNewLine("", 4); - this.appendNewLine("" + item.message + "", 6); - if (item.comment) { - this.appendNewLine("" + item.comment + "", 6); - } - this.appendNewLine('', 4); - }; - XLF.prototype.appendHeader = function () { - this.appendNewLine('', 0); - this.appendNewLine('', 0); - }; - XLF.prototype.appendFooter = function () { - this.appendNewLine('', 0); - }; - XLF.prototype.appendNewLine = function (content, indent) { - var line = new Line(indent); - line.append(content); - this.buffer.push(line.toString()); - }; - return XLF; -}()); -XLF.parse = function (xlfString) { - return new Promise(function (resolve, reject) { - var parser = new xml2js.Parser(); - var files = []; - parser.parseString(xlfString, function (err, result) { - if (err) { - reject("Failed to parse XLIFF string. " + err); - } - var fileNodes = result['xliff']['file']; - if (!fileNodes) { - reject('XLIFF file does not contain "xliff" or "file" node(s) required for parsing.'); - } - fileNodes.forEach(function (file) { - var originalFilePath = file.$.original; - if (!originalFilePath) { - reject('XLIFF file node does not contain original attribute to determine the original location of the resource file.'); - } - var language = file.$['target-language'].toLowerCase(); - if (!language) { - reject('XLIFF file node does not contain target-language attribute to determine translated language.'); - } - var messages = {}; - var transUnits = file.body[0]['trans-unit']; - transUnits.forEach(function (unit) { - var key = unit.$.id; - if (!unit.target) { - return; // No translation available - } - var val = unit.target.toString(); - if (key && val) { - messages[key] = decodeEntities(val); - } - else { - reject('XLIFF file does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.'); - } - }); - files.push({ messages: messages, originalFilePath: originalFilePath, language: language }); - }); - resolve(files); - }); - }); -}; -exports.XLF = XLF; -var vscodeLanguages = [ - 'chs', - 'cht', - 'jpn', - 'kor', - 'deu', - 'fra', - 'esn', - 'rus', - 'ita' -]; -var iso639_3_to_2 = { - 'chs': 'zh-cn', - 'cht': 'zh-tw', - 'csy': 'cs-cz', - 'deu': 'de', - 'enu': 'en', - 'esn': 'es', - 'fra': 'fr', - 'hun': 'hu', - 'ita': 'it', - 'jpn': 'ja', - 'kor': 'ko', - 'nld': 'nl', - 'plk': 'pl', - 'ptb': 'pt-br', - 'ptg': 'pt', - 'rus': 'ru', - 'sve': 'sv-se', - 'trk': 'tr' -}; -/** - * Used to map Transifex to VS Code language code representation. - */ -var iso639_2_to_3 = { - 'zh-hans': 'chs', - 'zh-hant': 'cht', - 'cs-cz': 'csy', - 'de': 'deu', - 'en': 'enu', - 'es': 'esn', - 'fr': 'fra', - 'hu': 'hun', - 'it': 'ita', - 'ja': 'jpn', - 'ko': 'kor', - 'nl': 'nld', - 'pl': 'plk', - 'pt-br': 'ptb', - 'pt': 'ptg', - 'ru': 'rus', - 'sv-se': 'sve', - 'tr': 'trk' -}; -function sortLanguages(directoryNames) { - return directoryNames.map(function (dirName) { - var lower = dirName.toLowerCase(); - return { - name: lower, - iso639_2: iso639_3_to_2[lower] - }; - }).sort(function (a, b) { - if (!a.iso639_2 && !b.iso639_2) { - return 0; - } - if (!a.iso639_2) { - return -1; - } - if (!b.iso639_2) { - return 1; - } - return a.iso639_2 < b.iso639_2 ? -1 : (a.iso639_2 > b.iso639_2 ? 1 : 0); - }); -} -function stripComments(content) { - /** - * First capturing group matches double quoted string - * Second matches single quotes string - * Third matches block comments - * Fourth matches line comments - */ - var regexp = /("(?:[^\\\"]*(?:\\.)?)*")|('(?:[^\\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g; - var result = content.replace(regexp, function (match, m1, m2, m3, m4) { - // Only one of m1, m2, m3, m4 matches - if (m3) { - // A block comment. Replace with nothing - return ''; - } - else if (m4) { - // A line comment. If it ends in \r?\n then keep it. - var length_1 = m4.length; - if (length_1 > 2 && m4[length_1 - 1] === '\n') { - return m4[length_1 - 2] === '\r' ? '\r\n' : '\n'; - } - else { - return ''; - } - } - else { - // We match a string - return match; - } - }); - return result; -} -function escapeCharacters(value) { - var result = []; - for (var i = 0; i < value.length; i++) { - var ch = value.charAt(i); - switch (ch) { - case '\'': - result.push('\\\''); - break; - case '"': - result.push('\\"'); - break; - case '\\': - result.push('\\\\'); - break; - case '\n': - result.push('\\n'); - break; - case '\r': - result.push('\\r'); - break; - case '\t': - result.push('\\t'); - break; - case '\b': - result.push('\\b'); - break; - case '\f': - result.push('\\f'); - break; - default: - result.push(ch); - } - } - return result.join(''); -} -function processCoreBundleFormat(fileHeader, json, emitter) { - var keysSection = json.keys; - var messageSection = json.messages; - var bundleSection = json.bundles; - var statistics = Object.create(null); - var total = 0; - var defaultMessages = Object.create(null); - var modules = Object.keys(keysSection); - modules.forEach(function (module) { - var keys = keysSection[module]; - var messages = messageSection[module]; - if (!messages || keys.length !== messages.length) { - emitter.emit('error', "Message for module " + module + " corrupted. Mismatch in number of keys and messages."); - return; - } - var messageMap = Object.create(null); - defaultMessages[module] = messageMap; - keys.map(function (key, i) { - total++; - if (Is.string(key)) { - messageMap[key] = messages[i]; - } - else { - messageMap[key.key] = messages[i]; - } - }); - }); - var languageDirectory = path.join(__dirname, '..', '..', 'i18n'); - var languages = sortLanguages(fs.readdirSync(languageDirectory).filter(function (item) { return fs.statSync(path.join(languageDirectory, item)).isDirectory(); })); - languages.forEach(function (language) { - if (!language.iso639_2) { - return; - } - if (process.env['VSCODE_BUILD_VERBOSE']) { - log("Generating nls bundles for: " + language.iso639_2); - } - statistics[language.iso639_2] = 0; - var localizedModules = Object.create(null); - var cwd = path.join(languageDirectory, language.name, 'src'); - modules.forEach(function (module) { - var order = keysSection[module]; - var i18nFile = path.join(cwd, module) + '.i18n.json'; - var messages = null; - if (fs.existsSync(i18nFile)) { - var content = stripComments(fs.readFileSync(i18nFile, 'utf8')); - messages = JSON.parse(content); - } - else { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log("No localized messages found for module " + module + ". Using default messages."); - } - messages = defaultMessages[module]; - statistics[language.iso639_2] = statistics[language.iso639_2] + Object.keys(messages).length; - } - var localizedMessages = []; - order.forEach(function (keyInfo) { - var key = null; - if (Is.string(keyInfo)) { - key = keyInfo; - } - else { - key = keyInfo.key; - } - var message = messages[key]; - if (!message) { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log("No localized message found for key " + key + " in module " + module + ". Using default message."); - } - message = defaultMessages[module][key]; - statistics[language.iso639_2] = statistics[language.iso639_2] + 1; - } - localizedMessages.push(message); - }); - localizedModules[module] = localizedMessages; - }); - Object.keys(bundleSection).forEach(function (bundle) { - var modules = bundleSection[bundle]; - var contents = [ - fileHeader, - "define(\"" + bundle + ".nls." + language.iso639_2 + "\", {" - ]; - modules.forEach(function (module, index) { - contents.push("\t\"" + module + "\": ["); - var messages = localizedModules[module]; - if (!messages) { - emitter.emit('error', "Didn't find messages for module " + module + "."); - return; - } - messages.forEach(function (message, index) { - contents.push("\t\t\"" + escapeCharacters(message) + (index < messages.length ? '",' : '"')); - }); - contents.push(index < modules.length - 1 ? '\t],' : '\t]'); - }); - contents.push('});'); - emitter.emit('data', new File({ path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') })); - }); - }); - Object.keys(statistics).forEach(function (key) { - var value = statistics[key]; - log(key + " has " + value + " untranslated strings."); - }); - vscodeLanguages.forEach(function (language) { - var iso639_2 = iso639_3_to_2[language]; - if (!iso639_2) { - log("\tCouldn't find iso639 2 mapping for language " + language + ". Using default language instead."); - } - else { - var stats = statistics[iso639_2]; - if (Is.undef(stats)) { - log("\tNo translations found for language " + language + ". Using default language instead."); - } - } - }); -} -function processNlsFiles(opts) { - return event_stream_1.through(function (file) { - var fileName = path.basename(file.path); - if (fileName === 'nls.metadata.json') { - var json = null; - if (file.isBuffer()) { - json = JSON.parse(file.contents.toString('utf8')); - } - else { - this.emit('error', "Failed to read component file: " + file.relative); - } - if (BundledFormat.is(json)) { - processCoreBundleFormat(opts.fileHeader, json, this); - } - } - this.emit('data', file); - }); -} -exports.processNlsFiles = processNlsFiles; -function prepareXlfFiles(projectName, extensionName) { - return event_stream_1.through(function (file) { - if (!file.isBuffer()) { - throw new Error("Failed to read component file: " + file.relative); - } - var extension = path.extname(file.path); - if (extension === '.json') { - var json = JSON.parse(file.contents.toString('utf8')); - if (BundledFormat.is(json)) { - importBundleJson(file, json, this); - } - else if (PackageJsonFormat.is(json) || ModuleJsonFormat.is(json)) { - importModuleOrPackageJson(file, json, projectName, this, extensionName); - } - else { - throw new Error("JSON format cannot be deduced for " + file.relative + "."); - } - } - else if (extension === '.isl') { - importIsl(file, this); - } - }); -} -exports.prepareXlfFiles = prepareXlfFiles; -var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup'; -/** - * Ensure to update those arrays when new resources are pushed to Transifex. - * Used because Transifex does not have API method to pull all project resources. - */ -var editorResources = [ - { name: 'vs/platform', project: editorProject }, - { name: 'vs/editor/contrib', project: editorProject }, - { name: 'vs/editor', project: editorProject }, - { name: 'vs/base', project: editorProject } -]; -var workbenchResources = [ - { name: 'vs/code', project: workbenchProject }, - { name: 'vs/workbench', project: workbenchProject }, - { name: 'vs/workbench/parts/cli', project: workbenchProject }, - { name: 'vs/workbench/parts/codeEditor', project: workbenchProject }, - { name: 'vs/workbench/parts/debug', project: workbenchProject }, - { name: 'vs/workbench/parts/emmet', project: workbenchProject }, - { name: 'vs/workbench/parts/execution', project: workbenchProject }, - { name: 'vs/workbench/parts/explorers', project: workbenchProject }, - { name: 'vs/workbench/parts/extensions', project: workbenchProject }, - { name: 'vs/workbench/parts/feedback', project: workbenchProject }, - { name: 'vs/workbench/parts/files', project: workbenchProject }, - { name: 'vs/workbench/parts/git', project: workbenchProject }, - { name: 'vs/workbench/parts/html', project: workbenchProject }, - { name: 'vs/workbench/parts/markers', project: workbenchProject }, - { name: 'vs/workbench/parts/nps', project: workbenchProject }, - { name: 'vs/workbench/parts/output', project: workbenchProject }, - { name: 'vs/workbench/parts/performance', project: workbenchProject }, - { name: 'vs/workbench/parts/preferences', project: workbenchProject }, - { name: 'vs/workbench/parts/quickopen', project: workbenchProject }, - { name: 'vs/workbench/parts/scm', project: workbenchProject }, - { name: 'vs/workbench/parts/search', project: workbenchProject }, - { name: 'vs/workbench/parts/snippets', project: workbenchProject }, - { name: 'vs/workbench/parts/tasks', project: workbenchProject }, - { name: 'vs/workbench/parts/terminal', project: workbenchProject }, - { name: 'vs/workbench/parts/themes', project: workbenchProject }, - { name: 'vs/workbench/parts/trust', project: workbenchProject }, - { name: 'vs/workbench/parts/update', project: workbenchProject }, - { name: 'vs/workbench/parts/watermark', project: workbenchProject }, - { name: 'vs/workbench/parts/welcome', project: workbenchProject }, - { name: 'vs/workbench/services/configuration', project: workbenchProject }, - { name: 'vs/workbench/services/editor', project: workbenchProject }, - { name: 'vs/workbench/services/files', project: workbenchProject }, - { name: 'vs/workbench/services/keybinding', project: workbenchProject }, - { name: 'vs/workbench/services/message', project: workbenchProject }, - { name: 'vs/workbench/services/mode', project: workbenchProject }, - { name: 'vs/workbench/services/textfile', project: workbenchProject }, - { name: 'vs/workbench/services/themes', project: workbenchProject }, - { name: 'setup_messages', project: workbenchProject } -]; -function getResource(sourceFile) { - var resource; - if (sourceFile.startsWith('vs/platform')) { - return { name: 'vs/platform', project: editorProject }; - } - else if (sourceFile.startsWith('vs/editor/contrib')) { - return { name: 'vs/editor/contrib', project: editorProject }; - } - else if (sourceFile.startsWith('vs/editor')) { - return { name: 'vs/editor', project: editorProject }; - } - else if (sourceFile.startsWith('vs/base')) { - return { name: 'vs/base', project: editorProject }; - } - else if (sourceFile.startsWith('vs/code')) { - return { name: 'vs/code', project: workbenchProject }; - } - else if (sourceFile.startsWith('vs/workbench/parts')) { - resource = sourceFile.split('/', 4).join('/'); - return { name: resource, project: workbenchProject }; - } - else if (sourceFile.startsWith('vs/workbench/services')) { - resource = sourceFile.split('/', 4).join('/'); - return { name: resource, project: workbenchProject }; - } - else if (sourceFile.startsWith('vs/workbench')) { - return { name: 'vs/workbench', project: workbenchProject }; - } - throw new Error("Could not identify the XLF bundle for " + sourceFile); -} -exports.getResource = getResource; -function importBundleJson(file, json, stream) { - var bundleXlfs = Object.create(null); - for (var source in json.keys) { - var projectResource = getResource(source); - var resource = projectResource.name; - var project = projectResource.project; - var keys = json.keys[source]; - var messages = json.messages[source]; - if (keys.length !== messages.length) { - throw new Error("There is a mismatch between keys and messages in " + file.relative); - } - var xlf = bundleXlfs[resource] ? bundleXlfs[resource] : bundleXlfs[resource] = new XLF(project); - xlf.addFile('src/' + source, keys, messages); - } - for (var resource in bundleXlfs) { - var newFilePath = bundleXlfs[resource].project + "/" + resource.replace(/\//g, '_') + ".xlf"; - var xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8') }); - stream.emit('data', xlfFile); - } -} -// Keeps existing XLF instances and a state of how many files were already processed for faster file emission -var extensions = Object.create(null); -function importModuleOrPackageJson(file, json, projectName, stream, extensionName) { - if (ModuleJsonFormat.is(json) && json['keys'].length !== json['messages'].length) { - throw new Error("There is a mismatch between keys and messages in " + file.relative); - } - // Prepare the source path for attribute in XLF & extract messages from JSON - var formattedSourcePath = file.relative.replace(/\\/g, '/'); - var messages = Object.keys(json).map(function (key) { return json[key].toString(); }); - // Stores the amount of localization files to be transformed to XLF before the emission - var localizationFilesCount, originalFilePath; - // If preparing XLF for external extension, then use different glob pattern and source path - if (extensionName) { - localizationFilesCount = glob.sync('**/*.nls.json').length; - originalFilePath = "" + formattedSourcePath.substr(0, formattedSourcePath.length - '.nls.json'.length); - } - else { - // Used for vscode/extensions folder - extensionName = formattedSourcePath.split('/')[0]; - localizationFilesCount = glob.sync("./extensions/" + extensionName + "/**/*.nls.json").length; - originalFilePath = "extensions/" + formattedSourcePath.substr(0, formattedSourcePath.length - '.nls.json'.length); - } - var extension = extensions[extensionName] ? - extensions[extensionName] : extensions[extensionName] = { xlf: new XLF(projectName), processed: 0 }; - if (ModuleJsonFormat.is(json)) { - extension.xlf.addFile(originalFilePath, json['keys'], json['messages']); - } - else { - extension.xlf.addFile(originalFilePath, Object.keys(json), messages); - } - // Check if XLF is populated with file nodes to emit it - if (++extensions[extensionName].processed === localizationFilesCount) { - var newFilePath = path.join(projectName, extensionName + '.xlf'); - var xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8') }); - stream.emit('data', xlfFile); - } -} -function importIsl(file, stream) { - var projectName, resourceFile; - if (path.basename(file.path) === 'Default.isl') { - projectName = setupProject; - resourceFile = 'setup_default.xlf'; - } - else { - projectName = workbenchProject; - resourceFile = 'setup_messages.xlf'; - } - var xlf = new XLF(projectName), keys = [], messages = []; - var model = new TextModel(file.contents.toString()); - var inMessageSection = false; - model.lines.forEach(function (line) { - if (line.length === 0) { - return; - } - var firstChar = line.charAt(0); - switch (firstChar) { - case ';': - // Comment line; - return; - case '[': - inMessageSection = '[Messages]' === line || '[CustomMessages]' === line; - return; - } - if (!inMessageSection) { - return; - } - var sections = line.split('='); - if (sections.length !== 2) { - throw new Error("Badly formatted message found: " + line); - } - else { - var key = sections[0]; - var value = sections[1]; - if (key.length > 0 && value.length > 0) { - keys.push(key); - messages.push(value); - } - } - }); - var originalPath = file.path.substring(file.cwd.length + 1, file.path.split('.')[0].length).replace(/\\/g, '/'); - xlf.addFile(originalPath, keys, messages); - // Emit only upon all ISL files combined into single XLF instance - var newFilePath = path.join(projectName, resourceFile); - var xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8') }); - stream.emit('data', xlfFile); -} -function pushXlfFiles(apiHostname, username, password) { - var tryGetPromises = []; - var updateCreatePromises = []; - return event_stream_1.through(function (file) { - var project = path.dirname(file.relative); - var fileName = path.basename(file.path); - var slug = fileName.substr(0, fileName.length - '.xlf'.length); - var credentials = username + ":" + password; - // Check if resource already exists, if not, then create it. - var promise = tryGetResource(project, slug, apiHostname, credentials); - tryGetPromises.push(promise); - promise.then(function (exists) { - if (exists) { - promise = updateResource(project, slug, file, apiHostname, credentials); - } - else { - promise = createResource(project, slug, file, apiHostname, credentials); - } - updateCreatePromises.push(promise); - }); - }, function () { - var _this = this; - // End the pipe only after all the communication with Transifex API happened - Promise.all(tryGetPromises).then(function () { - Promise.all(updateCreatePromises).then(function () { - _this.emit('end'); - }).catch(function (reason) { throw new Error(reason); }); - }).catch(function (reason) { throw new Error(reason); }); - }); -} -exports.pushXlfFiles = pushXlfFiles; -function tryGetResource(project, slug, apiHostname, credentials) { - return new Promise(function (resolve, reject) { - var options = { - hostname: apiHostname, - path: "/api/2/project/" + project + "/resource/" + slug + "/?details", - auth: credentials, - method: 'GET' - }; - var request = http.request(options, function (response) { - if (response.statusCode === 404) { - resolve(false); - } - else if (response.statusCode === 200) { - resolve(true); - } - else { - reject("Failed to query resource " + project + "/" + slug + ". Response: " + response.statusCode + " " + response.statusMessage); - } - }); - request.on('error', function (err) { - reject("Failed to get " + project + "/" + slug + " on Transifex: " + err); - }); - request.end(); - }); -} -function createResource(project, slug, xlfFile, apiHostname, credentials) { - return new Promise(function (resolve, reject) { - var data = JSON.stringify({ - 'content': xlfFile.contents.toString(), - 'name': slug, - 'slug': slug, - 'i18n_type': 'XLIFF' - }); - var options = { - hostname: apiHostname, - path: "/api/2/project/" + project + "/resources", - headers: { - 'Content-Type': 'application/json', - 'Content-Length': Buffer.byteLength(data) - }, - auth: credentials, - method: 'POST' - }; - var request = http.request(options, function (res) { - if (res.statusCode === 201) { - log("Resource " + project + "/" + slug + " successfully created on Transifex."); - } - else { - reject("Something went wrong in the request creating " + slug + " in " + project + ". " + res.statusCode); - } - }); - request.on('error', function (err) { - reject("Failed to create " + project + "/" + slug + " on Transifex: " + err); - }); - request.write(data); - request.end(); - }); -} -/** - * The following link provides information about how Transifex handles updates of a resource file: - * https://dev.befoolish.co/tx-docs/public/projects/updating-content#what-happens-when-you-update-files - */ -function updateResource(project, slug, xlfFile, apiHostname, credentials) { - return new Promise(function (resolve, reject) { - var data = JSON.stringify({ content: xlfFile.contents.toString() }); - var options = { - hostname: apiHostname, - path: "/api/2/project/" + project + "/resource/" + slug + "/content", - headers: { - 'Content-Type': 'application/json', - 'Content-Length': Buffer.byteLength(data) - }, - auth: credentials, - method: 'PUT' - }; - var request = http.request(options, function (res) { - if (res.statusCode === 200) { - res.setEncoding('utf8'); - var responseBuffer_1 = ''; - res.on('data', function (chunk) { - responseBuffer_1 += chunk; - }); - res.on('end', function () { - var response = JSON.parse(responseBuffer_1); - log("Resource " + project + "/" + slug + " successfully updated on Transifex. Strings added: " + response.strings_added + ", updated: " + response.strings_added + ", deleted: " + response.strings_added); - resolve(); - }); - } - else { - reject("Something went wrong in the request updating " + slug + " in " + project + ". " + res.statusCode); - } - }); - request.on('error', function (err) { - reject("Failed to update " + project + "/" + slug + " on Transifex: " + err); - }); - request.write(data); - request.end(); - }); -} -function obtainProjectResources(projectName) { - var resources = []; - if (projectName === editorProject) { - resources = editorResources; - } - else if (projectName === workbenchProject) { - resources = workbenchResources; - } - else if (projectName === extensionsProject) { - var extensionsToLocalize = glob.sync('./extensions/**/*.nls.json').map(function (extension) { return extension.split('/')[2]; }); - var resourcesToPull_1 = []; - extensionsToLocalize.forEach(function (extension) { - if (resourcesToPull_1.indexOf(extension) === -1) { - resourcesToPull_1.push(extension); - resources.push({ name: extension, project: projectName }); - } - }); - } - else if (projectName === setupProject) { - resources.push({ name: 'setup_default', project: setupProject }); - } - return resources; -} -function pullXlfFiles(projectName, apiHostname, username, password, languages, resources) { - if (!resources) { - resources = obtainProjectResources(projectName); - } - if (!resources) { - throw new Error('Transifex projects and resources must be defined to be able to pull translations from Transifex.'); - } - var credentials = username + ":" + password; - var expectedTranslationsCount = languages.length * resources.length; - var translationsRetrieved = 0, called = false; - return event_stream_1.readable(function (count, callback) { - // Mark end of stream when all resources were retrieved - if (translationsRetrieved === expectedTranslationsCount) { - return this.emit('end'); - } - if (!called) { - called = true; - var stream_1 = this; - // Retrieve XLF files from main projects - languages.map(function (language) { - resources.map(function (resource) { - retrieveResource(language, resource, apiHostname, credentials).then(function (file) { - stream_1.emit('data', file); - translationsRetrieved++; - }).catch(function (error) { throw new Error(error); }); - }); - }); - } - callback(); - }); -} -exports.pullXlfFiles = pullXlfFiles; -function retrieveResource(language, resource, apiHostname, credentials) { - return new Promise(function (resolve, reject) { - var slug = resource.name.replace(/\//g, '_'); - var project = resource.project; - var iso639 = language.toLowerCase(); - var options = { - hostname: apiHostname, - path: "/api/2/project/" + project + "/resource/" + slug + "/translation/" + iso639 + "?file&mode=onlyreviewed", - auth: credentials, - method: 'GET' - }; - var request = http.request(options, function (res) { - var xlfBuffer = []; - res.on('data', function (chunk) { return xlfBuffer.push(chunk); }); - res.on('end', function () { - if (res.statusCode === 200) { - resolve(new File({ contents: Buffer.concat(xlfBuffer), path: project + "/" + iso639_2_to_3[language] + "/" + slug + ".xlf" })); - } - reject(slug + " in " + project + " returned no data. Response code: " + res.statusCode + "."); - }); - }); - request.on('error', function (err) { - reject("Failed to query resource " + slug + " with the following error: " + err); - }); - request.end(); - }); -} -function prepareJsonFiles() { - var parsePromises = []; - return event_stream_1.through(function (xlf) { - var stream = this; - var parsePromise = XLF.parse(xlf.contents.toString()); - parsePromises.push(parsePromise); - parsePromise.then(function (resolvedFiles) { - resolvedFiles.forEach(function (file) { - var messages = file.messages, translatedFile; - // ISL file path always starts with 'build/' - if (file.originalFilePath.startsWith('build/')) { - var defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true }; - if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) { - return; - } - translatedFile = createIslFile('..', file.originalFilePath, messages, iso639_2_to_3[file.language]); - } - else { - translatedFile = createI18nFile(iso639_2_to_3[file.language], file.originalFilePath, messages); - } - stream.emit('data', translatedFile); - }); - }, function (rejectReason) { - throw new Error("XLF parsing error: " + rejectReason); - }); - }, function () { - var _this = this; - Promise.all(parsePromises) - .then(function () { _this.emit('end'); }) - .catch(function (reason) { throw new Error(reason); }); - }); -} -exports.prepareJsonFiles = prepareJsonFiles; -function createI18nFile(base, originalFilePath, messages) { - var content = [ - '/*---------------------------------------------------------------------------------------------', - ' * Copyright (c) Microsoft Corporation. All rights reserved.', - ' * Licensed under the MIT License. See License.txt in the project root for license information.', - ' *--------------------------------------------------------------------------------------------*/', - '// Do not edit this file. It is machine generated.' - ].join('\n') + '\n' + JSON.stringify(messages, null, '\t').replace(/\r\n/g, '\n'); - return new File({ - path: path.join(base, originalFilePath + '.i18n.json'), - contents: new Buffer(content, 'utf8') - }); -} -var languageNames = { - 'chs': 'Simplified Chinese', - 'cht': 'Traditional Chinese', - 'kor': 'Korean' -}; -var languageIds = { - 'chs': '$0804', - 'cht': '$0404', - 'kor': '$0412' -}; -var encodings = { - 'chs': 'CP936', - 'cht': 'CP950', - 'jpn': 'CP932', - 'kor': 'CP949', - 'deu': 'CP1252', - 'fra': 'CP1252', - 'esn': 'CP1252', - 'rus': 'CP1251', - 'ita': 'CP1252' -}; -function createIslFile(base, originalFilePath, messages, language) { - var content = []; - var originalContent; - if (path.basename(originalFilePath) === 'Default') { - originalContent = new TextModel(fs.readFileSync(originalFilePath + '.isl', 'utf8')); - } - else { - originalContent = new TextModel(fs.readFileSync(originalFilePath + '.en.isl', 'utf8')); - } - originalContent.lines.forEach(function (line) { - if (line.length > 0) { - var firstChar = line.charAt(0); - if (firstChar === '[' || firstChar === ';') { - if (line === '; *** Inno Setup version 5.5.3+ English messages ***') { - content.push("; *** Inno Setup version 5.5.3+ " + languageNames[language] + " messages ***"); - } - else { - content.push(line); - } - } - else { - var sections = line.split('='); - var key = sections[0]; - var translated = line; - if (key) { - if (key === 'LanguageName') { - translated = key + "=" + languageNames[language]; - } - else if (key === 'LanguageID') { - translated = key + "=" + languageIds[language]; - } - else if (key === 'LanguageCodePage') { - translated = key + "=" + encodings[language].substr(2); - } - else { - var translatedMessage = messages[key]; - if (translatedMessage) { - translated = key + "=" + translatedMessage; - } - } - } - content.push(translated); - } - } - }); - var tag = iso639_3_to_2[language]; - var basename = path.basename(originalFilePath); - var filePath = path.join(base, path.dirname(originalFilePath), basename) + "." + tag + ".isl"; - return new File({ - path: filePath, - contents: iconv.encode(new Buffer(content.join('\r\n'), 'utf8'), encodings[language]) - }); -} -function encodeEntities(value) { - var result = []; - for (var i = 0; i < value.length; i++) { - var ch = value[i]; - switch (ch) { - case '<': - result.push('<'); - break; - case '>': - result.push('>'); - break; - case '&': - result.push('&'); - break; - default: - result.push(ch); - } - } - return result.join(''); -} -function decodeEntities(value) { - return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); -} +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var fs = require("fs"); +var event_stream_1 = require("event-stream"); +var File = require("vinyl"); +var Is = require("is"); +var xml2js = require("xml2js"); +var glob = require("glob"); +var http = require("http"); +var util = require('gulp-util'); +var iconv = require('iconv-lite'); +function log(message) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + util.log.apply(util, [util.colors.green('[i18n]'), message].concat(rest)); +} +var LocalizeInfo; +(function (LocalizeInfo) { + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.key) && (Is.undef(candidate.comment) || (Is.array(candidate.comment) && candidate.comment.every(function (element) { return Is.string(element); }))); + } + LocalizeInfo.is = is; +})(LocalizeInfo || (LocalizeInfo = {})); +var BundledFormat; +(function (BundledFormat) { + function is(value) { + if (Is.undef(value)) { + return false; + } + var candidate = value; + var length = Object.keys(value).length; + return length === 3 && Is.defined(candidate.keys) && Is.defined(candidate.messages) && Is.defined(candidate.bundles); + } + BundledFormat.is = is; +})(BundledFormat || (BundledFormat = {})); +var PackageJsonFormat; +(function (PackageJsonFormat) { + function is(value) { + if (Is.undef(value) || !Is.object(value)) { + return false; + } + return Object.keys(value).every(function (key) { + var element = value[key]; + return Is.string(element) || (Is.object(element) && Is.defined(element.message) && Is.defined(element.comment)); + }); + } + PackageJsonFormat.is = is; +})(PackageJsonFormat || (PackageJsonFormat = {})); +var ModuleJsonFormat; +(function (ModuleJsonFormat) { + function is(value) { + var candidate = value; + return Is.defined(candidate) + && Is.array(candidate.messages) && candidate.messages.every(function (message) { return Is.string(message); }) + && Is.array(candidate.keys) && candidate.keys.every(function (key) { return Is.string(key) || LocalizeInfo.is(key); }); + } + ModuleJsonFormat.is = is; +})(ModuleJsonFormat || (ModuleJsonFormat = {})); +var Line = (function () { + function Line(indent) { + if (indent === void 0) { indent = 0; } + this.indent = indent; + this.buffer = []; + if (indent > 0) { + this.buffer.push(new Array(indent + 1).join(' ')); + } + } + Line.prototype.append = function (value) { + this.buffer.push(value); + return this; + }; + Line.prototype.toString = function () { + return this.buffer.join(''); + }; + return Line; +}()); +exports.Line = Line; +var TextModel = (function () { + function TextModel(contents) { + this._lines = contents.split(/\r\n|\r|\n/); + } + Object.defineProperty(TextModel.prototype, "lines", { + get: function () { + return this._lines; + }, + enumerable: true, + configurable: true + }); + return TextModel; +}()); +var XLF = (function () { + function XLF(project) { + this.project = project; + this.buffer = []; + this.files = Object.create(null); + } + XLF.prototype.toString = function () { + this.appendHeader(); + for (var file in this.files) { + this.appendNewLine("", 2); + for (var _i = 0, _a = this.files[file]; _i < _a.length; _i++) { + var item = _a[_i]; + this.addStringItem(item); + } + this.appendNewLine('', 2); + } + this.appendFooter(); + return this.buffer.join('\r\n'); + }; + XLF.prototype.addFile = function (original, keys, messages) { + this.files[original] = []; + var existingKeys = []; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + // Ignore duplicate keys because Transifex does not populate those with translated values. + if (existingKeys.indexOf(key) !== -1) { + continue; + } + existingKeys.push(key); + var message = encodeEntities(messages[keys.indexOf(key)]); + var comment = undefined; + // Check if the message contains description (if so, it becomes an object type in JSON) + if (Is.string(key)) { + this.files[original].push({ id: key, message: message, comment: comment }); + } + else { + if (key['comment'] && key['comment'].length > 0) { + comment = key['comment'].map(function (comment) { return encodeEntities(comment); }).join('\r\n'); + } + this.files[original].push({ id: key['key'], message: message, comment: comment }); + } + } + }; + XLF.prototype.addStringItem = function (item) { + if (!item.id || !item.message) { + throw new Error('No item ID or value specified.'); + } + this.appendNewLine("", 4); + this.appendNewLine("" + item.message + "", 6); + if (item.comment) { + this.appendNewLine("" + item.comment + "", 6); + } + this.appendNewLine('', 4); + }; + XLF.prototype.appendHeader = function () { + this.appendNewLine('', 0); + this.appendNewLine('', 0); + }; + XLF.prototype.appendFooter = function () { + this.appendNewLine('', 0); + }; + XLF.prototype.appendNewLine = function (content, indent) { + var line = new Line(indent); + line.append(content); + this.buffer.push(line.toString()); + }; + return XLF; +}()); +XLF.parse = function (xlfString) { + return new Promise(function (resolve, reject) { + var parser = new xml2js.Parser(); + var files = []; + parser.parseString(xlfString, function (err, result) { + if (err) { + reject("Failed to parse XLIFF string. " + err); + } + var fileNodes = result['xliff']['file']; + if (!fileNodes) { + reject('XLIFF file does not contain "xliff" or "file" node(s) required for parsing.'); + } + fileNodes.forEach(function (file) { + var originalFilePath = file.$.original; + if (!originalFilePath) { + reject('XLIFF file node does not contain original attribute to determine the original location of the resource file.'); + } + var language = file.$['target-language'].toLowerCase(); + if (!language) { + reject('XLIFF file node does not contain target-language attribute to determine translated language.'); + } + var messages = {}; + var transUnits = file.body[0]['trans-unit']; + transUnits.forEach(function (unit) { + var key = unit.$.id; + if (!unit.target) { + return; // No translation available + } + var val = unit.target.toString(); + if (key && val) { + messages[key] = decodeEntities(val); + } + else { + reject('XLIFF file does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.'); + } + }); + files.push({ messages: messages, originalFilePath: originalFilePath, language: language }); + }); + resolve(files); + }); + }); +}; +exports.XLF = XLF; +var vscodeLanguages = [ + 'chs', + 'cht', + 'jpn', + 'kor', + 'deu', + 'fra', + 'esn', + 'rus', + 'ita' +]; +var iso639_3_to_2 = { + 'chs': 'zh-cn', + 'cht': 'zh-tw', + 'csy': 'cs-cz', + 'deu': 'de', + 'enu': 'en', + 'esn': 'es', + 'fra': 'fr', + 'hun': 'hu', + 'ita': 'it', + 'jpn': 'ja', + 'kor': 'ko', + 'nld': 'nl', + 'plk': 'pl', + 'ptb': 'pt-br', + 'ptg': 'pt', + 'rus': 'ru', + 'sve': 'sv-se', + 'trk': 'tr' +}; +/** + * Used to map Transifex to VS Code language code representation. + */ +var iso639_2_to_3 = { + 'zh-hans': 'chs', + 'zh-hant': 'cht', + 'cs-cz': 'csy', + 'de': 'deu', + 'en': 'enu', + 'es': 'esn', + 'fr': 'fra', + 'hu': 'hun', + 'it': 'ita', + 'ja': 'jpn', + 'ko': 'kor', + 'nl': 'nld', + 'pl': 'plk', + 'pt-br': 'ptb', + 'pt': 'ptg', + 'ru': 'rus', + 'sv-se': 'sve', + 'tr': 'trk' +}; +function sortLanguages(directoryNames) { + return directoryNames.map(function (dirName) { + var lower = dirName.toLowerCase(); + return { + name: lower, + iso639_2: iso639_3_to_2[lower] + }; + }).sort(function (a, b) { + if (!a.iso639_2 && !b.iso639_2) { + return 0; + } + if (!a.iso639_2) { + return -1; + } + if (!b.iso639_2) { + return 1; + } + return a.iso639_2 < b.iso639_2 ? -1 : (a.iso639_2 > b.iso639_2 ? 1 : 0); + }); +} +function stripComments(content) { + /** + * First capturing group matches double quoted string + * Second matches single quotes string + * Third matches block comments + * Fourth matches line comments + */ + var regexp = /("(?:[^\\\"]*(?:\\.)?)*")|('(?:[^\\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g; + var result = content.replace(regexp, function (match, m1, m2, m3, m4) { + // Only one of m1, m2, m3, m4 matches + if (m3) { + // A block comment. Replace with nothing + return ''; + } + else if (m4) { + // A line comment. If it ends in \r?\n then keep it. + var length_1 = m4.length; + if (length_1 > 2 && m4[length_1 - 1] === '\n') { + return m4[length_1 - 2] === '\r' ? '\r\n' : '\n'; + } + else { + return ''; + } + } + else { + // We match a string + return match; + } + }); + return result; +} +function escapeCharacters(value) { + var result = []; + for (var i = 0; i < value.length; i++) { + var ch = value.charAt(i); + switch (ch) { + case '\'': + result.push('\\\''); + break; + case '"': + result.push('\\"'); + break; + case '\\': + result.push('\\\\'); + break; + case '\n': + result.push('\\n'); + break; + case '\r': + result.push('\\r'); + break; + case '\t': + result.push('\\t'); + break; + case '\b': + result.push('\\b'); + break; + case '\f': + result.push('\\f'); + break; + default: + result.push(ch); + } + } + return result.join(''); +} +function processCoreBundleFormat(fileHeader, json, emitter) { + var keysSection = json.keys; + var messageSection = json.messages; + var bundleSection = json.bundles; + var statistics = Object.create(null); + var total = 0; + var defaultMessages = Object.create(null); + var modules = Object.keys(keysSection); + modules.forEach(function (module) { + var keys = keysSection[module]; + var messages = messageSection[module]; + if (!messages || keys.length !== messages.length) { + emitter.emit('error', "Message for module " + module + " corrupted. Mismatch in number of keys and messages."); + return; + } + var messageMap = Object.create(null); + defaultMessages[module] = messageMap; + keys.map(function (key, i) { + total++; + if (Is.string(key)) { + messageMap[key] = messages[i]; + } + else { + messageMap[key.key] = messages[i]; + } + }); + }); + var languageDirectory = path.join(__dirname, '..', '..', 'i18n'); + var languages = sortLanguages(fs.readdirSync(languageDirectory).filter(function (item) { return fs.statSync(path.join(languageDirectory, item)).isDirectory(); })); + languages.forEach(function (language) { + if (!language.iso639_2) { + return; + } + if (process.env['VSCODE_BUILD_VERBOSE']) { + log("Generating nls bundles for: " + language.iso639_2); + } + statistics[language.iso639_2] = 0; + var localizedModules = Object.create(null); + var cwd = path.join(languageDirectory, language.name, 'src'); + modules.forEach(function (module) { + var order = keysSection[module]; + var i18nFile = path.join(cwd, module) + '.i18n.json'; + var messages = null; + if (fs.existsSync(i18nFile)) { + var content = stripComments(fs.readFileSync(i18nFile, 'utf8')); + messages = JSON.parse(content); + } + else { + if (process.env['VSCODE_BUILD_VERBOSE']) { + log("No localized messages found for module " + module + ". Using default messages."); + } + messages = defaultMessages[module]; + statistics[language.iso639_2] = statistics[language.iso639_2] + Object.keys(messages).length; + } + var localizedMessages = []; + order.forEach(function (keyInfo) { + var key = null; + if (Is.string(keyInfo)) { + key = keyInfo; + } + else { + key = keyInfo.key; + } + var message = messages[key]; + if (!message) { + if (process.env['VSCODE_BUILD_VERBOSE']) { + log("No localized message found for key " + key + " in module " + module + ". Using default message."); + } + message = defaultMessages[module][key]; + statistics[language.iso639_2] = statistics[language.iso639_2] + 1; + } + localizedMessages.push(message); + }); + localizedModules[module] = localizedMessages; + }); + Object.keys(bundleSection).forEach(function (bundle) { + var modules = bundleSection[bundle]; + var contents = [ + fileHeader, + "define(\"" + bundle + ".nls." + language.iso639_2 + "\", {" + ]; + modules.forEach(function (module, index) { + contents.push("\t\"" + module + "\": ["); + var messages = localizedModules[module]; + if (!messages) { + emitter.emit('error', "Didn't find messages for module " + module + "."); + return; + } + messages.forEach(function (message, index) { + contents.push("\t\t\"" + escapeCharacters(message) + (index < messages.length ? '",' : '"')); + }); + contents.push(index < modules.length - 1 ? '\t],' : '\t]'); + }); + contents.push('});'); + emitter.emit('data', new File({ path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') })); + }); + }); + Object.keys(statistics).forEach(function (key) { + var value = statistics[key]; + log(key + " has " + value + " untranslated strings."); + }); + vscodeLanguages.forEach(function (language) { + var iso639_2 = iso639_3_to_2[language]; + if (!iso639_2) { + log("\tCouldn't find iso639 2 mapping for language " + language + ". Using default language instead."); + } + else { + var stats = statistics[iso639_2]; + if (Is.undef(stats)) { + log("\tNo translations found for language " + language + ". Using default language instead."); + } + } + }); +} +function processNlsFiles(opts) { + return event_stream_1.through(function (file) { + var fileName = path.basename(file.path); + if (fileName === 'nls.metadata.json') { + var json = null; + if (file.isBuffer()) { + json = JSON.parse(file.contents.toString('utf8')); + } + else { + this.emit('error', "Failed to read component file: " + file.relative); + } + if (BundledFormat.is(json)) { + processCoreBundleFormat(opts.fileHeader, json, this); + } + } + this.emit('data', file); + }); +} +exports.processNlsFiles = processNlsFiles; +function prepareXlfFiles(projectName, extensionName) { + return event_stream_1.through(function (file) { + if (!file.isBuffer()) { + throw new Error("Failed to read component file: " + file.relative); + } + var extension = path.extname(file.path); + if (extension === '.json') { + var json = JSON.parse(file.contents.toString('utf8')); + if (BundledFormat.is(json)) { + importBundleJson(file, json, this); + } + else if (PackageJsonFormat.is(json) || ModuleJsonFormat.is(json)) { + importModuleOrPackageJson(file, json, projectName, this, extensionName); + } + else { + throw new Error("JSON format cannot be deduced for " + file.relative + "."); + } + } + else if (extension === '.isl') { + importIsl(file, this); + } + }); +} +exports.prepareXlfFiles = prepareXlfFiles; +var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup'; +/** + * Ensure to update those arrays when new resources are pushed to Transifex. + * Used because Transifex does not have API method to pull all project resources. + */ +var editorResources = [ + { name: 'vs/platform', project: editorProject }, + { name: 'vs/editor/contrib', project: editorProject }, + { name: 'vs/editor', project: editorProject }, + { name: 'vs/base', project: editorProject } +]; +var workbenchResources = [ + { name: 'vs/code', project: workbenchProject }, + { name: 'vs/workbench', project: workbenchProject }, + { name: 'vs/workbench/parts/cli', project: workbenchProject }, + { name: 'vs/workbench/parts/codeEditor', project: workbenchProject }, + { name: 'vs/workbench/parts/debug', project: workbenchProject }, + { name: 'vs/workbench/parts/emmet', project: workbenchProject }, + { name: 'vs/workbench/parts/execution', project: workbenchProject }, + { name: 'vs/workbench/parts/explorers', project: workbenchProject }, + { name: 'vs/workbench/parts/extensions', project: workbenchProject }, + { name: 'vs/workbench/parts/feedback', project: workbenchProject }, + { name: 'vs/workbench/parts/files', project: workbenchProject }, + { name: 'vs/workbench/parts/html', project: workbenchProject }, + { name: 'vs/workbench/parts/markers', project: workbenchProject }, + { name: 'vs/workbench/parts/nps', project: workbenchProject }, + { name: 'vs/workbench/parts/output', project: workbenchProject }, + { name: 'vs/workbench/parts/performance', project: workbenchProject }, + { name: 'vs/workbench/parts/preferences', project: workbenchProject }, + { name: 'vs/workbench/parts/quickopen', project: workbenchProject }, + { name: 'vs/workbench/parts/scm', project: workbenchProject }, + { name: 'vs/workbench/parts/search', project: workbenchProject }, + { name: 'vs/workbench/parts/snippets', project: workbenchProject }, + { name: 'vs/workbench/parts/tasks', project: workbenchProject }, + { name: 'vs/workbench/parts/terminal', project: workbenchProject }, + { name: 'vs/workbench/parts/themes', project: workbenchProject }, + { name: 'vs/workbench/parts/trust', project: workbenchProject }, + { name: 'vs/workbench/parts/update', project: workbenchProject }, + { name: 'vs/workbench/parts/watermark', project: workbenchProject }, + { name: 'vs/workbench/parts/welcome', project: workbenchProject }, + { name: 'vs/workbench/services/configuration', project: workbenchProject }, + { name: 'vs/workbench/services/editor', project: workbenchProject }, + { name: 'vs/workbench/services/files', project: workbenchProject }, + { name: 'vs/workbench/services/keybinding', project: workbenchProject }, + { name: 'vs/workbench/services/message', project: workbenchProject }, + { name: 'vs/workbench/services/mode', project: workbenchProject }, + { name: 'vs/workbench/services/textfile', project: workbenchProject }, + { name: 'vs/workbench/services/themes', project: workbenchProject }, + { name: 'setup_messages', project: workbenchProject } +]; +function getResource(sourceFile) { + var resource; + if (/^vs\/platform/.test(sourceFile)) { + return { name: 'vs/platform', project: editorProject }; + } + else if (/^vs\/editor\/contrib/.test(sourceFile)) { + return { name: 'vs/editor/contrib', project: editorProject }; + } + else if (/^vs\/editor/.test(sourceFile)) { + return { name: 'vs/editor', project: editorProject }; + } + else if (/^vs\/base/.test(sourceFile)) { + return { name: 'vs/base', project: editorProject }; + } + else if (/^vs\/code/.test(sourceFile)) { + return { name: 'vs/code', project: workbenchProject }; + } + else if (/^vs\/workbench\/parts/.test(sourceFile)) { + resource = sourceFile.split('/', 4).join('/'); + return { name: resource, project: workbenchProject }; + } + else if (/^vs\/workbench\/services/.test(sourceFile)) { + resource = sourceFile.split('/', 4).join('/'); + return { name: resource, project: workbenchProject }; + } + else if (/^vs\/workbench/.test(sourceFile)) { + return { name: 'vs/workbench', project: workbenchProject }; + } + throw new Error("Could not identify the XLF bundle for " + sourceFile); +} +exports.getResource = getResource; +function importBundleJson(file, json, stream) { + var bundleXlfs = Object.create(null); + for (var source in json.keys) { + var projectResource = getResource(source); + var resource = projectResource.name; + var project = projectResource.project; + var keys = json.keys[source]; + var messages = json.messages[source]; + if (keys.length !== messages.length) { + throw new Error("There is a mismatch between keys and messages in " + file.relative); + } + var xlf = bundleXlfs[resource] ? bundleXlfs[resource] : bundleXlfs[resource] = new XLF(project); + xlf.addFile('src/' + source, keys, messages); + } + for (var resource in bundleXlfs) { + var newFilePath = bundleXlfs[resource].project + "/" + resource.replace(/\//g, '_') + ".xlf"; + var xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8') }); + stream.emit('data', xlfFile); + } +} +// Keeps existing XLF instances and a state of how many files were already processed for faster file emission +var extensions = Object.create(null); +function importModuleOrPackageJson(file, json, projectName, stream, extensionName) { + if (ModuleJsonFormat.is(json) && json['keys'].length !== json['messages'].length) { + throw new Error("There is a mismatch between keys and messages in " + file.relative); + } + // Prepare the source path for attribute in XLF & extract messages from JSON + var formattedSourcePath = file.relative.replace(/\\/g, '/'); + var messages = Object.keys(json).map(function (key) { return json[key].toString(); }); + // Stores the amount of localization files to be transformed to XLF before the emission + var localizationFilesCount, originalFilePath; + // If preparing XLF for external extension, then use different glob pattern and source path + if (extensionName) { + localizationFilesCount = glob.sync('**/*.nls.json').length; + originalFilePath = "" + formattedSourcePath.substr(0, formattedSourcePath.length - '.nls.json'.length); + } + else { + // Used for vscode/extensions folder + extensionName = formattedSourcePath.split('/')[0]; + localizationFilesCount = glob.sync("./extensions/" + extensionName + "/**/*.nls.json").length; + originalFilePath = "extensions/" + formattedSourcePath.substr(0, formattedSourcePath.length - '.nls.json'.length); + } + var extension = extensions[extensionName] ? + extensions[extensionName] : extensions[extensionName] = { xlf: new XLF(projectName), processed: 0 }; + if (ModuleJsonFormat.is(json)) { + extension.xlf.addFile(originalFilePath, json['keys'], json['messages']); + } + else { + extension.xlf.addFile(originalFilePath, Object.keys(json), messages); + } + // Check if XLF is populated with file nodes to emit it + if (++extensions[extensionName].processed === localizationFilesCount) { + var newFilePath = path.join(projectName, extensionName + '.xlf'); + var xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8') }); + stream.emit('data', xlfFile); + } +} +function importIsl(file, stream) { + var projectName, resourceFile; + if (path.basename(file.path) === 'Default.isl') { + projectName = setupProject; + resourceFile = 'setup_default.xlf'; + } + else { + projectName = workbenchProject; + resourceFile = 'setup_messages.xlf'; + } + var xlf = new XLF(projectName), keys = [], messages = []; + var model = new TextModel(file.contents.toString()); + var inMessageSection = false; + model.lines.forEach(function (line) { + if (line.length === 0) { + return; + } + var firstChar = line.charAt(0); + switch (firstChar) { + case ';': + // Comment line; + return; + case '[': + inMessageSection = '[Messages]' === line || '[CustomMessages]' === line; + return; + } + if (!inMessageSection) { + return; + } + var sections = line.split('='); + if (sections.length !== 2) { + throw new Error("Badly formatted message found: " + line); + } + else { + var key = sections[0]; + var value = sections[1]; + if (key.length > 0 && value.length > 0) { + keys.push(key); + messages.push(value); + } + } + }); + var originalPath = file.path.substring(file.cwd.length + 1, file.path.split('.')[0].length).replace(/\\/g, '/'); + xlf.addFile(originalPath, keys, messages); + // Emit only upon all ISL files combined into single XLF instance + var newFilePath = path.join(projectName, resourceFile); + var xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8') }); + stream.emit('data', xlfFile); +} +function pushXlfFiles(apiHostname, username, password) { + var tryGetPromises = []; + var updateCreatePromises = []; + return event_stream_1.through(function (file) { + var project = path.dirname(file.relative); + var fileName = path.basename(file.path); + var slug = fileName.substr(0, fileName.length - '.xlf'.length); + var credentials = username + ":" + password; + // Check if resource already exists, if not, then create it. + var promise = tryGetResource(project, slug, apiHostname, credentials); + tryGetPromises.push(promise); + promise.then(function (exists) { + if (exists) { + promise = updateResource(project, slug, file, apiHostname, credentials); + } + else { + promise = createResource(project, slug, file, apiHostname, credentials); + } + updateCreatePromises.push(promise); + }); + }, function () { + var _this = this; + // End the pipe only after all the communication with Transifex API happened + Promise.all(tryGetPromises).then(function () { + Promise.all(updateCreatePromises).then(function () { + _this.emit('end'); + }).catch(function (reason) { throw new Error(reason); }); + }).catch(function (reason) { throw new Error(reason); }); + }); +} +exports.pushXlfFiles = pushXlfFiles; +function tryGetResource(project, slug, apiHostname, credentials) { + return new Promise(function (resolve, reject) { + var options = { + hostname: apiHostname, + path: "/api/2/project/" + project + "/resource/" + slug + "/?details", + auth: credentials, + method: 'GET' + }; + var request = http.request(options, function (response) { + if (response.statusCode === 404) { + resolve(false); + } + else if (response.statusCode === 200) { + resolve(true); + } + else { + reject("Failed to query resource " + project + "/" + slug + ". Response: " + response.statusCode + " " + response.statusMessage); + } + }); + request.on('error', function (err) { + reject("Failed to get " + project + "/" + slug + " on Transifex: " + err); + }); + request.end(); + }); +} +function createResource(project, slug, xlfFile, apiHostname, credentials) { + return new Promise(function (resolve, reject) { + var data = JSON.stringify({ + 'content': xlfFile.contents.toString(), + 'name': slug, + 'slug': slug, + 'i18n_type': 'XLIFF' + }); + var options = { + hostname: apiHostname, + path: "/api/2/project/" + project + "/resources", + headers: { + 'Content-Type': 'application/json', + 'Content-Length': Buffer.byteLength(data) + }, + auth: credentials, + method: 'POST' + }; + var request = http.request(options, function (res) { + if (res.statusCode === 201) { + log("Resource " + project + "/" + slug + " successfully created on Transifex."); + } + else { + reject("Something went wrong in the request creating " + slug + " in " + project + ". " + res.statusCode); + } + }); + request.on('error', function (err) { + reject("Failed to create " + project + "/" + slug + " on Transifex: " + err); + }); + request.write(data); + request.end(); + }); +} +/** + * The following link provides information about how Transifex handles updates of a resource file: + * https://dev.befoolish.co/tx-docs/public/projects/updating-content#what-happens-when-you-update-files + */ +function updateResource(project, slug, xlfFile, apiHostname, credentials) { + return new Promise(function (resolve, reject) { + var data = JSON.stringify({ content: xlfFile.contents.toString() }); + var options = { + hostname: apiHostname, + path: "/api/2/project/" + project + "/resource/" + slug + "/content", + headers: { + 'Content-Type': 'application/json', + 'Content-Length': Buffer.byteLength(data) + }, + auth: credentials, + method: 'PUT' + }; + var request = http.request(options, function (res) { + if (res.statusCode === 200) { + res.setEncoding('utf8'); + var responseBuffer_1 = ''; + res.on('data', function (chunk) { + responseBuffer_1 += chunk; + }); + res.on('end', function () { + var response = JSON.parse(responseBuffer_1); + log("Resource " + project + "/" + slug + " successfully updated on Transifex. Strings added: " + response.strings_added + ", updated: " + response.strings_added + ", deleted: " + response.strings_added); + resolve(); + }); + } + else { + reject("Something went wrong in the request updating " + slug + " in " + project + ". " + res.statusCode); + } + }); + request.on('error', function (err) { + reject("Failed to update " + project + "/" + slug + " on Transifex: " + err); + }); + request.write(data); + request.end(); + }); +} +function obtainProjectResources(projectName) { + var resources = []; + if (projectName === editorProject) { + resources = editorResources; + } + else if (projectName === workbenchProject) { + resources = workbenchResources; + } + else if (projectName === extensionsProject) { + var extensionsToLocalize = glob.sync('./extensions/**/*.nls.json').map(function (extension) { return extension.split('/')[2]; }); + var resourcesToPull_1 = []; + extensionsToLocalize.forEach(function (extension) { + if (resourcesToPull_1.indexOf(extension) === -1) { + resourcesToPull_1.push(extension); + resources.push({ name: extension, project: projectName }); + } + }); + } + else if (projectName === setupProject) { + resources.push({ name: 'setup_default', project: setupProject }); + } + return resources; +} +function pullXlfFiles(projectName, apiHostname, username, password, languages, resources) { + if (!resources) { + resources = obtainProjectResources(projectName); + } + if (!resources) { + throw new Error('Transifex projects and resources must be defined to be able to pull translations from Transifex.'); + } + var credentials = username + ":" + password; + var expectedTranslationsCount = languages.length * resources.length; + var translationsRetrieved = 0, called = false; + return event_stream_1.readable(function (count, callback) { + // Mark end of stream when all resources were retrieved + if (translationsRetrieved === expectedTranslationsCount) { + return this.emit('end'); + } + if (!called) { + called = true; + var stream_1 = this; + // Retrieve XLF files from main projects + languages.map(function (language) { + resources.map(function (resource) { + retrieveResource(language, resource, apiHostname, credentials).then(function (file) { + stream_1.emit('data', file); + translationsRetrieved++; + }).catch(function (error) { throw new Error(error); }); + }); + }); + } + callback(); + }); +} +exports.pullXlfFiles = pullXlfFiles; +function retrieveResource(language, resource, apiHostname, credentials) { + return new Promise(function (resolve, reject) { + var slug = resource.name.replace(/\//g, '_'); + var project = resource.project; + var iso639 = language.toLowerCase(); + var options = { + hostname: apiHostname, + path: "/api/2/project/" + project + "/resource/" + slug + "/translation/" + iso639 + "?file&mode=onlyreviewed", + auth: credentials, + method: 'GET' + }; + var request = http.request(options, function (res) { + var xlfBuffer = []; + res.on('data', function (chunk) { return xlfBuffer.push(chunk); }); + res.on('end', function () { + if (res.statusCode === 200) { + resolve(new File({ contents: Buffer.concat(xlfBuffer), path: project + "/" + iso639_2_to_3[language] + "/" + slug + ".xlf" })); + } + reject(slug + " in " + project + " returned no data. Response code: " + res.statusCode + "."); + }); + }); + request.on('error', function (err) { + reject("Failed to query resource " + slug + " with the following error: " + err); + }); + request.end(); + }); +} +function prepareJsonFiles() { + var parsePromises = []; + return event_stream_1.through(function (xlf) { + var stream = this; + var parsePromise = XLF.parse(xlf.contents.toString()); + parsePromises.push(parsePromise); + parsePromise.then(function (resolvedFiles) { + resolvedFiles.forEach(function (file) { + var messages = file.messages, translatedFile; + // ISL file path always starts with 'build/' + if (/^build\//.test(file.originalFilePath)) { + var defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true }; + if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) { + return; + } + translatedFile = createIslFile('..', file.originalFilePath, messages, iso639_2_to_3[file.language]); + } + else { + translatedFile = createI18nFile(iso639_2_to_3[file.language], file.originalFilePath, messages); + } + stream.emit('data', translatedFile); + }); + }, function (rejectReason) { + throw new Error("XLF parsing error: " + rejectReason); + }); + }, function () { + var _this = this; + Promise.all(parsePromises) + .then(function () { _this.emit('end'); }) + .catch(function (reason) { throw new Error(reason); }); + }); +} +exports.prepareJsonFiles = prepareJsonFiles; +function createI18nFile(base, originalFilePath, messages) { + var content = [ + '/*---------------------------------------------------------------------------------------------', + ' * Copyright (c) Microsoft Corporation. All rights reserved.', + ' * Licensed under the MIT License. See License.txt in the project root for license information.', + ' *--------------------------------------------------------------------------------------------*/', + '// Do not edit this file. It is machine generated.' + ].join('\n') + '\n' + JSON.stringify(messages, null, '\t').replace(/\r\n/g, '\n'); + return new File({ + path: path.join(base, originalFilePath + '.i18n.json'), + contents: new Buffer(content, 'utf8') + }); +} +var languageNames = { + 'chs': 'Simplified Chinese', + 'cht': 'Traditional Chinese', + 'kor': 'Korean' +}; +var languageIds = { + 'chs': '$0804', + 'cht': '$0404', + 'kor': '$0412' +}; +var encodings = { + 'chs': 'CP936', + 'cht': 'CP950', + 'jpn': 'CP932', + 'kor': 'CP949', + 'deu': 'CP1252', + 'fra': 'CP1252', + 'esn': 'CP1252', + 'rus': 'CP1251', + 'ita': 'CP1252' +}; +function createIslFile(base, originalFilePath, messages, language) { + var content = []; + var originalContent; + if (path.basename(originalFilePath) === 'Default') { + originalContent = new TextModel(fs.readFileSync(originalFilePath + '.isl', 'utf8')); + } + else { + originalContent = new TextModel(fs.readFileSync(originalFilePath + '.en.isl', 'utf8')); + } + originalContent.lines.forEach(function (line) { + if (line.length > 0) { + var firstChar = line.charAt(0); + if (firstChar === '[' || firstChar === ';') { + if (line === '; *** Inno Setup version 5.5.3+ English messages ***') { + content.push("; *** Inno Setup version 5.5.3+ " + languageNames[language] + " messages ***"); + } + else { + content.push(line); + } + } + else { + var sections = line.split('='); + var key = sections[0]; + var translated = line; + if (key) { + if (key === 'LanguageName') { + translated = key + "=" + languageNames[language]; + } + else if (key === 'LanguageID') { + translated = key + "=" + languageIds[language]; + } + else if (key === 'LanguageCodePage') { + translated = key + "=" + encodings[language].substr(2); + } + else { + var translatedMessage = messages[key]; + if (translatedMessage) { + translated = key + "=" + translatedMessage; + } + } + } + content.push(translated); + } + } + }); + var tag = iso639_3_to_2[language]; + var basename = path.basename(originalFilePath); + var filePath = path.join(base, path.dirname(originalFilePath), basename) + "." + tag + ".isl"; + return new File({ + path: filePath, + contents: iconv.encode(new Buffer(content.join('\r\n'), 'utf8'), encodings[language]) + }); +} +function encodeEntities(value) { + var result = []; + for (var i = 0; i < value.length; i++) { + var ch = value[i]; + switch (ch) { + case '<': + result.push('<'); + break; + case '>': + result.push('>'); + break; + case '&': + result.push('&'); + break; + default: + result.push(ch); + } + } + return result.join(''); +} +function decodeEntities(value) { + return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); +} diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index cdf8e56e4ac..e999847e067 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -140,23 +140,23 @@ class TextModel { } export class XLF { - private buffer: string[]; + private buffer: string[]; private files: Map; - constructor(public project: string) { - this.buffer = []; + constructor(public project: string) { + this.buffer = []; this.files = Object.create(null); } - public toString(): string { - this.appendHeader(); + public toString(): string { + this.appendHeader(); for (let file in this.files) { this.appendNewLine(``, 2); for (let item of this.files[file]) { this.addStringItem(item); } - this.appendNewLine('', 2); + this.appendNewLine('', 2); } this.appendFooter(); @@ -190,43 +190,43 @@ export class XLF { } } - private addStringItem(item: Item): void { - if (!item.id || !item.message) { - throw new Error('No item ID or value specified.'); - } + private addStringItem(item: Item): void { + if (!item.id || !item.message) { + throw new Error('No item ID or value specified.'); + } - this.appendNewLine(``, 4); - this.appendNewLine(`${item.message}`, 6); + this.appendNewLine(``, 4); + this.appendNewLine(`${item.message}`, 6); - if (item.comment) { - this.appendNewLine(`${item.comment}`, 6); - } + if (item.comment) { + this.appendNewLine(`${item.comment}`, 6); + } - this.appendNewLine('', 4); + this.appendNewLine('', 4); } - private appendHeader(): void { - this.appendNewLine('', 0); - this.appendNewLine('', 0); + private appendHeader(): void { + this.appendNewLine('', 0); + this.appendNewLine('', 0); } - private appendFooter(): void { - this.appendNewLine('', 0); - } + private appendFooter(): void { + this.appendNewLine('', 0); + } - private appendNewLine(content: string, indent?: number): void { - let line = new Line(indent); - line.append(content); - this.buffer.push(line.toString()); - } + private appendNewLine(content: string, indent?: number): void { + let line = new Line(indent); + line.append(content); + this.buffer.push(line.toString()); + } - static parse = function(xlfString: string) : Promise { + static parse = function (xlfString: string): Promise { return new Promise((resolve, reject) => { let parser = new xml2js.Parser(); let files: { messages: Map, originalFilePath: string, language: string }[] = []; - parser.parseString(xlfString, function(err, result) { + parser.parseString(xlfString, function (err, result) { if (err) { reject(`Failed to parse XLIFF string. ${err}`); } @@ -372,7 +372,7 @@ function stripComments(content: string): string { // A line comment. If it ends in \r?\n then keep it. let length = m4.length; if (length > 2 && m4[length - 1] === '\n') { - return m4[length - 2] === '\r' ? '\r\n': '\n'; + return m4[length - 2] === '\r' ? '\r\n' : '\n'; } else { return ''; } @@ -384,11 +384,11 @@ function stripComments(content: string): string { return result; } -function escapeCharacters(value:string):string { - var result:string[] = []; +function escapeCharacters(value: string): string { + var result: string[] = []; for (var i = 0; i < value.length; i++) { var ch = value.charAt(i); - switch(ch) { + switch (ch) { case '\'': result.push('\\\''); break; @@ -420,7 +420,7 @@ function escapeCharacters(value:string):string { return result.join(''); } -function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter: any) { +function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitter: any) { let keysSection = json.keys; let messageSection = json.messages; let bundleSection = json.bundles; @@ -511,12 +511,12 @@ function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter return; } messages.forEach((message, index) => { - contents.push(`\t\t"${escapeCharacters(message)}${index < messages.length ? '",': '"'}`); + contents.push(`\t\t"${escapeCharacters(message)}${index < messages.length ? '",' : '"'}`); }); contents.push(index < modules.length - 1 ? '\t],' : '\t]'); }); contents.push('});'); - emitter.emit('data', new File( { path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') })); + emitter.emit('data', new File({ path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') })); }); }); Object.keys(statistics).forEach(key => { @@ -536,8 +536,8 @@ function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter }); } -export function processNlsFiles(opts:{fileHeader:string;}): ThroughStream { - return through(function(file: File) { +export function processNlsFiles(opts: { fileHeader: string; }): ThroughStream { + return through(function (file: File) { let fileName = path.basename(file.path); if (fileName === 'nls.metadata.json') { let json = null; @@ -637,27 +637,27 @@ const workbenchResources: Resource[] = [ export function getResource(sourceFile: string): Resource { let resource: string; - if (sourceFile.startsWith('vs/platform')) { + if (/^vs\/platform/.test(sourceFile)) { return { name: 'vs/platform', project: editorProject }; - } else if (sourceFile.startsWith('vs/editor/contrib')) { + } else if (/^vs\/editor\/contrib/.test(sourceFile)) { return { name: 'vs/editor/contrib', project: editorProject }; - } else if (sourceFile.startsWith('vs/editor')) { + } else if (/^vs\/editor/.test(sourceFile)) { return { name: 'vs/editor', project: editorProject }; - } else if (sourceFile.startsWith('vs/base')) { + } else if (/^vs\/base/.test(sourceFile)) { return { name: 'vs/base', project: editorProject }; - } else if (sourceFile.startsWith('vs/code')) { + } else if (/^vs\/code/.test(sourceFile)) { return { name: 'vs/code', project: workbenchProject }; - } else if (sourceFile.startsWith('vs/workbench/parts')) { + } else if (/^vs\/workbench\/parts/.test(sourceFile)) { resource = sourceFile.split('/', 4).join('/'); return { name: resource, project: workbenchProject }; - } else if (sourceFile.startsWith('vs/workbench/services')) { + } else if (/^vs\/workbench\/services/.test(sourceFile)) { resource = sourceFile.split('/', 4).join('/'); return { name: resource, project: workbenchProject }; - } else if (sourceFile.startsWith('vs/workbench')) { + } else if (/^vs\/workbench/.test(sourceFile)) { return { name: 'vs/workbench', project: workbenchProject }; } - throw new Error (`Could not identify the XLF bundle for ${sourceFile}`); + throw new Error(`Could not identify the XLF bundle for ${sourceFile}`); } @@ -681,7 +681,7 @@ function importBundleJson(file: File, json: BundledFormat, stream: ThroughStream for (let resource in bundleXlfs) { const newFilePath = `${bundleXlfs[resource].project}/${resource.replace(/\//g, '_')}.xlf`; - const xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8')}); + const xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8') }); stream.emit('data', xlfFile); } } @@ -723,7 +723,7 @@ function importModuleOrPackageJson(file: File, json: ModuleJsonFormat | PackageJ // Check if XLF is populated with file nodes to emit it if (++extensions[extensionName].processed === localizationFilesCount) { const newFilePath = path.join(projectName, extensionName + '.xlf'); - const xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8')}); + const xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8') }); stream.emit('data', xlfFile); } } @@ -774,12 +774,12 @@ function importIsl(file: File, stream: ThroughStream) { } }); - const originalPath = file.path.substring(file.cwd.length+1, file.path.split('.')[0].length).replace(/\\/g, '/'); + const originalPath = file.path.substring(file.cwd.length + 1, file.path.split('.')[0].length).replace(/\\/g, '/'); xlf.addFile(originalPath, keys, messages); // Emit only upon all ISL files combined into single XLF instance const newFilePath = path.join(projectName, resourceFile); - const xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8')}); + const xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8') }); stream.emit('data', xlfFile); } @@ -787,7 +787,7 @@ export function pushXlfFiles(apiHostname: string, username: string, password: st let tryGetPromises = []; let updateCreatePromises = []; - return through(function(file: File) { + return through(function (file: File) { const project = path.dirname(file.relative); const fileName = path.basename(file.path); const slug = fileName.substr(0, fileName.length - '.xlf'.length); @@ -805,7 +805,7 @@ export function pushXlfFiles(apiHostname: string, username: string, password: st updateCreatePromises.push(promise); }); - }, function() { + }, function () { // End the pipe only after all the communication with Transifex API happened Promise.all(tryGetPromises).then(() => { Promise.all(updateCreatePromises).then(() => { @@ -880,7 +880,7 @@ function createResource(project: string, slug: string, xlfFile: File, apiHostnam * The following link provides information about how Transifex handles updates of a resource file: * https://dev.befoolish.co/tx-docs/public/projects/updating-content#what-happens-when-you-update-files */ -function updateResource(project: string, slug: string, xlfFile: File, apiHostname: string, credentials: string) : Promise { +function updateResource(project: string, slug: string, xlfFile: File, apiHostname: string, credentials: string): Promise { return new Promise((resolve, reject) => { const data = JSON.stringify({ content: xlfFile.contents.toString() }); const options = { @@ -956,7 +956,7 @@ export function pullXlfFiles(projectName: string, apiHostname: string, username: let expectedTranslationsCount = languages.length * resources.length; let translationsRetrieved = 0, called = false; - return readable(function(count, callback) { + return readable(function (count, callback) { // Mark end of stream when all resources were retrieved if (translationsRetrieved === expectedTranslationsCount) { return this.emit('end'); @@ -967,8 +967,8 @@ export function pullXlfFiles(projectName: string, apiHostname: string, username: const stream = this; // Retrieve XLF files from main projects - languages.map(function(language) { - resources.map(function(resource) { + languages.map(function (language) { + resources.map(function (resource) { retrieveResource(language, resource, apiHostname, credentials).then((file: File) => { stream.emit('data', file); translationsRetrieved++; @@ -994,14 +994,14 @@ function retrieveResource(language: string, resource: Resource, apiHostname, cre }; let request = http.request(options, (res) => { - let xlfBuffer: Buffer[] = []; - res.on('data', (chunk) => xlfBuffer.push(chunk)); - res.on('end', () => { - if (res.statusCode === 200) { - resolve(new File({ contents: Buffer.concat(xlfBuffer), path: `${project}/${iso639_2_to_3[language]}/${slug}.xlf` })); - } - reject(`${slug} in ${project} returned no data. Response code: ${res.statusCode}.`); - }); + let xlfBuffer: Buffer[] = []; + res.on('data', (chunk: Buffer) => xlfBuffer.push(chunk)); + res.on('end', () => { + if (res.statusCode === 200) { + resolve(new File({ contents: Buffer.concat(xlfBuffer), path: `${project}/${iso639_2_to_3[language]}/${slug}.xlf` })); + } + reject(`${slug} in ${project} returned no data. Response code: ${res.statusCode}.`); + }); }); request.on('error', (err) => { reject(`Failed to query resource ${slug} with the following error: ${err}`); @@ -1013,17 +1013,17 @@ function retrieveResource(language: string, resource: Resource, apiHostname, cre export function prepareJsonFiles(): ThroughStream { let parsePromises: Promise[] = []; - return through(function(xlf: File) { + return through(function (xlf: File) { let stream = this; let parsePromise = XLF.parse(xlf.contents.toString()); parsePromises.push(parsePromise); parsePromise.then( - function(resolvedFiles) { + function (resolvedFiles) { resolvedFiles.forEach(file => { let messages = file.messages, translatedFile; // ISL file path always starts with 'build/' - if (file.originalFilePath.startsWith('build/')) { + if (/^build\//.test(file.originalFilePath)) { const defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true }; if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) { return; @@ -1037,11 +1037,11 @@ export function prepareJsonFiles(): ThroughStream { stream.emit('data', translatedFile); }); }, - function(rejectReason) { + function (rejectReason) { throw new Error(`XLF parsing error: ${rejectReason}`); } ); - }, function() { + }, function () { Promise.all(parsePromises) .then(() => { this.emit('end'); }) .catch(reason => { throw new Error(reason); }); @@ -1161,6 +1161,6 @@ function encodeEntities(value: string): string { return result.join(''); } -function decodeEntities(value:string): string { +function decodeEntities(value: string): string { return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); } \ No newline at end of file diff --git a/build/lib/nls.js b/build/lib/nls.js index e695200d1bd..da8e6a27a53 100644 --- a/build/lib/nls.js +++ b/build/lib/nls.js @@ -1,355 +1,355 @@ -"use strict"; -var ts = require("./typescript/typescriptServices"); -var lazy = require("lazy.js"); -var event_stream_1 = require("event-stream"); -var File = require("vinyl"); -var sm = require("source-map"); -var assign = require("object-assign"); -var path = require("path"); -var CollectStepResult; -(function (CollectStepResult) { - CollectStepResult[CollectStepResult["Yes"] = 0] = "Yes"; - CollectStepResult[CollectStepResult["YesAndRecurse"] = 1] = "YesAndRecurse"; - CollectStepResult[CollectStepResult["No"] = 2] = "No"; - CollectStepResult[CollectStepResult["NoAndRecurse"] = 3] = "NoAndRecurse"; -})(CollectStepResult || (CollectStepResult = {})); -function collect(node, fn) { - var result = []; - function loop(node) { - var stepResult = fn(node); - if (stepResult === CollectStepResult.Yes || stepResult === CollectStepResult.YesAndRecurse) { - result.push(node); - } - if (stepResult === CollectStepResult.YesAndRecurse || stepResult === CollectStepResult.NoAndRecurse) { - ts.forEachChild(node, loop); - } - } - loop(node); - return result; -} -function clone(object) { - var result = {}; - for (var id in object) { - result[id] = object[id]; - } - return result; -} -function template(lines) { - var indent = '', wrap = ''; - if (lines.length > 1) { - indent = '\t'; - wrap = '\n'; - } - return "/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\ndefine([], [" + (wrap + lines.map(function (l) { return indent + l; }).join(',\n') + wrap) + "]);"; -} -/** - * Returns a stream containing the patched JavaScript and source maps. - */ -function nls() { - var input = event_stream_1.through(); - var output = input.pipe(event_stream_1.through(function (f) { - var _this = this; - if (!f.sourceMap) { - return this.emit('error', new Error("File " + f.relative + " does not have sourcemaps.")); - } - var source = f.sourceMap.sources[0]; - if (!source) { - return this.emit('error', new Error("File " + f.relative + " does not have a source in the source map.")); - } - var root = f.sourceMap.sourceRoot; - if (root) { - source = path.join(root, source); - } - var typescript = f.sourceMap.sourcesContent[0]; - if (!typescript) { - return this.emit('error', new Error("File " + f.relative + " does not have the original content in the source map.")); - } - nls.patchFiles(f, typescript).forEach(function (f) { return _this.emit('data', f); }); - })); - return event_stream_1.duplex(input, output); -} -function isImportNode(node) { - return node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */; -} -(function (nls_1) { - function fileFrom(file, contents, path) { - if (path === void 0) { path = file.path; } - return new File({ - contents: new Buffer(contents), - base: file.base, - cwd: file.cwd, - path: path - }); - } - nls_1.fileFrom = fileFrom; - function mappedPositionFrom(source, lc) { - return { source: source, line: lc.line + 1, column: lc.character }; - } - nls_1.mappedPositionFrom = mappedPositionFrom; - function lcFrom(position) { - return { line: position.line - 1, character: position.column }; - } - nls_1.lcFrom = lcFrom; - var SingleFileServiceHost = (function () { - function SingleFileServiceHost(options, filename, contents) { - var _this = this; - this.options = options; - this.filename = filename; - this.getCompilationSettings = function () { return _this.options; }; - this.getScriptFileNames = function () { return [_this.filename]; }; - this.getScriptVersion = function () { return '1'; }; - this.getScriptSnapshot = function (name) { return name === _this.filename ? _this.file : _this.lib; }; - this.getCurrentDirectory = function () { return ''; }; - this.getDefaultLibFileName = function () { return 'lib.d.ts'; }; - this.file = ts.ScriptSnapshot.fromString(contents); - this.lib = ts.ScriptSnapshot.fromString(''); - } - return SingleFileServiceHost; - }()); - nls_1.SingleFileServiceHost = SingleFileServiceHost; - function isCallExpressionWithinTextSpanCollectStep(textSpan, node) { - if (!ts.textSpanContainsTextSpan({ start: node.pos, length: node.end - node.pos }, textSpan)) { - return CollectStepResult.No; - } - return node.kind === 160 /* CallExpression */ ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; - } - function analyze(contents, options) { - if (options === void 0) { options = {}; } - var filename = 'file.ts'; - var serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents); - var service = ts.createLanguageService(serviceHost); - var sourceFile = service.getSourceFile(filename); - // all imports - var imports = lazy(collect(sourceFile, function (n) { return isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; })); - // import nls = require('vs/nls'); - var importEqualsDeclarations = imports - .filter(function (n) { return n.kind === 211 /* ImportEqualsDeclaration */; }) - .map(function (n) { return n; }) - .filter(function (d) { return d.moduleReference.kind === 222 /* ExternalModuleReference */; }) - .filter(function (d) { return d.moduleReference.expression.getText() === '\'vs/nls\''; }); - // import ... from 'vs/nls'; - var importDeclarations = imports - .filter(function (n) { return n.kind === 212 /* ImportDeclaration */; }) - .map(function (n) { return n; }) - .filter(function (d) { return d.moduleSpecifier.kind === 8 /* StringLiteral */; }) - .filter(function (d) { return d.moduleSpecifier.getText() === '\'vs/nls\''; }) - .filter(function (d) { return !!d.importClause && !!d.importClause.namedBindings; }); - var nlsExpressions = importEqualsDeclarations - .map(function (d) { return d.moduleReference.expression; }) - .concat(importDeclarations.map(function (d) { return d.moduleSpecifier; })) - .map(function (d) { return ({ - start: ts.getLineAndCharacterOfPosition(sourceFile, d.getStart()), - end: ts.getLineAndCharacterOfPosition(sourceFile, d.getEnd()) - }); }); - // `nls.localize(...)` calls - var nlsLocalizeCallExpressions = importDeclarations - .filter(function (d) { return d.importClause.namedBindings.kind === 214 /* NamespaceImport */; }) - .map(function (d) { return d.importClause.namedBindings.name; }) - .concat(importEqualsDeclarations.map(function (d) { return d.name; })) - .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) - .flatten() - .filter(function (r) { return !r.isWriteAccess; }) - .map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); }) - .map(function (a) { return lazy(a).last(); }) - .filter(function (n) { return !!n; }) - .map(function (n) { return n; }) - .filter(function (n) { return n.expression.kind === 158 /* PropertyAccessExpression */ && n.expression.name.getText() === 'localize'; }); - // `localize` named imports - var allLocalizeImportDeclarations = importDeclarations - .filter(function (d) { return d.importClause.namedBindings.kind === 215 /* NamedImports */; }) - .map(function (d) { return d.importClause.namedBindings.elements; }) - .flatten(); - // `localize` read-only references - var localizeReferences = allLocalizeImportDeclarations - .filter(function (d) { return d.name.getText() === 'localize'; }) - .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) - .flatten() - .filter(function (r) { return !r.isWriteAccess; }); - // custom named `localize` read-only references - var namedLocalizeReferences = allLocalizeImportDeclarations - .filter(function (d) { return d.propertyName && d.propertyName.getText() === 'localize'; }) - .map(function (n) { return service.getReferencesAtPosition(filename, n.name.pos + 1); }) - .flatten() - .filter(function (r) { return !r.isWriteAccess; }); - // find the deepest call expressions AST nodes that contain those references - var localizeCallExpressions = localizeReferences - .concat(namedLocalizeReferences) - .map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); }) - .map(function (a) { return lazy(a).last(); }) - .filter(function (n) { return !!n; }) - .map(function (n) { return n; }); - // collect everything - var localizeCalls = nlsLocalizeCallExpressions - .concat(localizeCallExpressions) - .map(function (e) { return e.arguments; }) - .filter(function (a) { return a.length > 1; }) - .sort(function (a, b) { return a[0].getStart() - b[0].getStart(); }) - .map(function (a) { return ({ - keySpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getEnd()) }, - key: a[0].getText(), - valueSpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getEnd()) }, - value: a[1].getText() - }); }); - return { - localizeCalls: localizeCalls.toArray(), - nlsExpressions: nlsExpressions.toArray() - }; - } - nls_1.analyze = analyze; - var TextModel = (function () { - function TextModel(contents) { - var regex = /\r\n|\r|\n/g; - var index = 0; - var match; - this.lines = []; - this.lineEndings = []; - while (match = regex.exec(contents)) { - this.lines.push(contents.substring(index, match.index)); - this.lineEndings.push(match[0]); - index = regex.lastIndex; - } - if (contents.length > 0) { - this.lines.push(contents.substring(index, contents.length)); - this.lineEndings.push(''); - } - } - TextModel.prototype.get = function (index) { - return this.lines[index]; - }; - TextModel.prototype.set = function (index, line) { - this.lines[index] = line; - }; - Object.defineProperty(TextModel.prototype, "lineCount", { - get: function () { - return this.lines.length; - }, - enumerable: true, - configurable: true - }); - /** - * Applies patch(es) to the model. - * Multiple patches must be ordered. - * Does not support patches spanning multiple lines. - */ - TextModel.prototype.apply = function (patch) { - var startLineNumber = patch.span.start.line; - var endLineNumber = patch.span.end.line; - var startLine = this.lines[startLineNumber] || ''; - var endLine = this.lines[endLineNumber] || ''; - this.lines[startLineNumber] = [ - startLine.substring(0, patch.span.start.character), - patch.content, - endLine.substring(patch.span.end.character) - ].join(''); - for (var i = startLineNumber + 1; i <= endLineNumber; i++) { - this.lines[i] = ''; - } - }; - TextModel.prototype.toString = function () { - return lazy(this.lines).zip(this.lineEndings) - .flatten().toArray().join(''); - }; - return TextModel; - }()); - nls_1.TextModel = TextModel; - function patchJavascript(patches, contents, moduleId) { - var model = new nls.TextModel(contents); - // patch the localize calls - lazy(patches).reverse().each(function (p) { return model.apply(p); }); - // patch the 'vs/nls' imports - var firstLine = model.get(0); - var patchedFirstLine = firstLine.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1"); - model.set(0, patchedFirstLine); - return model.toString(); - } - nls_1.patchJavascript = patchJavascript; - function patchSourcemap(patches, rsm, smc) { - var smg = new sm.SourceMapGenerator({ - file: rsm.file, - sourceRoot: rsm.sourceRoot - }); - patches = patches.reverse(); - var currentLine = -1; - var currentLineDiff = 0; - var source = null; - smc.eachMapping(function (m) { - var patch = patches[patches.length - 1]; - var original = { line: m.originalLine, column: m.originalColumn }; - var generated = { line: m.generatedLine, column: m.generatedColumn }; - if (currentLine !== generated.line) { - currentLineDiff = 0; - } - currentLine = generated.line; - generated.column += currentLineDiff; - if (patch && m.generatedLine - 1 === patch.span.end.line && m.generatedColumn === patch.span.end.character) { - var originalLength = patch.span.end.character - patch.span.start.character; - var modifiedLength = patch.content.length; - var lengthDiff = modifiedLength - originalLength; - currentLineDiff += lengthDiff; - generated.column += lengthDiff; - patches.pop(); - } - source = rsm.sourceRoot ? path.relative(rsm.sourceRoot, m.source) : m.source; - source = source.replace(/\\/g, '/'); - smg.addMapping({ source: source, name: m.name, original: original, generated: generated }); - }, null, sm.SourceMapConsumer.GENERATED_ORDER); - if (source) { - smg.setSourceContent(source, smc.sourceContentFor(source)); - } - return JSON.parse(smg.toString()); - } - nls_1.patchSourcemap = patchSourcemap; - function patch(moduleId, typescript, javascript, sourcemap) { - var _a = analyze(typescript), localizeCalls = _a.localizeCalls, nlsExpressions = _a.nlsExpressions; - if (localizeCalls.length === 0) { - return { javascript: javascript, sourcemap: sourcemap }; - } - var nlsKeys = template(localizeCalls.map(function (lc) { return lc.key; })); - var nls = template(localizeCalls.map(function (lc) { return lc.value; })); - var smc = new sm.SourceMapConsumer(sourcemap); - var positionFrom = mappedPositionFrom.bind(null, sourcemap.sources[0]); - var i = 0; - // build patches - var patches = lazy(localizeCalls) - .map(function (lc) { return ([ - { range: lc.keySpan, content: '' + (i++) }, - { range: lc.valueSpan, content: 'null' } - ]); }) - .flatten() - .map(function (c) { - var start = lcFrom(smc.generatedPositionFor(positionFrom(c.range.start))); - var end = lcFrom(smc.generatedPositionFor(positionFrom(c.range.end))); - return { span: { start: start, end: end }, content: c.content }; - }) - .toArray(); - javascript = patchJavascript(patches, javascript, moduleId); - // since imports are not within the sourcemap information, - // we must do this MacGyver style - if (nlsExpressions.length) { - javascript = javascript.replace(/^define\(.*$/m, function (line) { - return line.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1"); - }); - } - sourcemap = patchSourcemap(patches, sourcemap, smc); - return { javascript: javascript, sourcemap: sourcemap, nlsKeys: nlsKeys, nls: nls }; - } - nls_1.patch = patch; - function patchFiles(javascriptFile, typescript) { - // hack? - var moduleId = javascriptFile.relative - .replace(/\.js$/, '') - .replace(/\\/g, '/'); - var _a = patch(moduleId, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap), javascript = _a.javascript, sourcemap = _a.sourcemap, nlsKeys = _a.nlsKeys, nls = _a.nls; - var result = [fileFrom(javascriptFile, javascript)]; - result[0].sourceMap = sourcemap; - if (nlsKeys) { - result.push(fileFrom(javascriptFile, nlsKeys, javascriptFile.path.replace(/\.js$/, '.nls.keys.js'))); - } - if (nls) { - result.push(fileFrom(javascriptFile, nls, javascriptFile.path.replace(/\.js$/, '.nls.js'))); - } - return result; - } - nls_1.patchFiles = patchFiles; -})(nls || (nls = {})); -module.exports = nls; +"use strict"; +var ts = require("./typescript/typescriptServices"); +var lazy = require("lazy.js"); +var event_stream_1 = require("event-stream"); +var File = require("vinyl"); +var sm = require("source-map"); +var assign = require("object-assign"); +var path = require("path"); +var CollectStepResult; +(function (CollectStepResult) { + CollectStepResult[CollectStepResult["Yes"] = 0] = "Yes"; + CollectStepResult[CollectStepResult["YesAndRecurse"] = 1] = "YesAndRecurse"; + CollectStepResult[CollectStepResult["No"] = 2] = "No"; + CollectStepResult[CollectStepResult["NoAndRecurse"] = 3] = "NoAndRecurse"; +})(CollectStepResult || (CollectStepResult = {})); +function collect(node, fn) { + var result = []; + function loop(node) { + var stepResult = fn(node); + if (stepResult === CollectStepResult.Yes || stepResult === CollectStepResult.YesAndRecurse) { + result.push(node); + } + if (stepResult === CollectStepResult.YesAndRecurse || stepResult === CollectStepResult.NoAndRecurse) { + ts.forEachChild(node, loop); + } + } + loop(node); + return result; +} +function clone(object) { + var result = {}; + for (var id in object) { + result[id] = object[id]; + } + return result; +} +function template(lines) { + var indent = '', wrap = ''; + if (lines.length > 1) { + indent = '\t'; + wrap = '\n'; + } + return "/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\ndefine([], [" + (wrap + lines.map(function (l) { return indent + l; }).join(',\n') + wrap) + "]);"; +} +/** + * Returns a stream containing the patched JavaScript and source maps. + */ +function nls() { + var input = event_stream_1.through(); + var output = input.pipe(event_stream_1.through(function (f) { + var _this = this; + if (!f.sourceMap) { + return this.emit('error', new Error("File " + f.relative + " does not have sourcemaps.")); + } + var source = f.sourceMap.sources[0]; + if (!source) { + return this.emit('error', new Error("File " + f.relative + " does not have a source in the source map.")); + } + var root = f.sourceMap.sourceRoot; + if (root) { + source = path.join(root, source); + } + var typescript = f.sourceMap.sourcesContent[0]; + if (!typescript) { + return this.emit('error', new Error("File " + f.relative + " does not have the original content in the source map.")); + } + nls.patchFiles(f, typescript).forEach(function (f) { return _this.emit('data', f); }); + })); + return event_stream_1.duplex(input, output); +} +function isImportNode(node) { + return node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */; +} +(function (nls_1) { + function fileFrom(file, contents, path) { + if (path === void 0) { path = file.path; } + return new File({ + contents: new Buffer(contents), + base: file.base, + cwd: file.cwd, + path: path + }); + } + nls_1.fileFrom = fileFrom; + function mappedPositionFrom(source, lc) { + return { source: source, line: lc.line + 1, column: lc.character }; + } + nls_1.mappedPositionFrom = mappedPositionFrom; + function lcFrom(position) { + return { line: position.line - 1, character: position.column }; + } + nls_1.lcFrom = lcFrom; + var SingleFileServiceHost = (function () { + function SingleFileServiceHost(options, filename, contents) { + var _this = this; + this.options = options; + this.filename = filename; + this.getCompilationSettings = function () { return _this.options; }; + this.getScriptFileNames = function () { return [_this.filename]; }; + this.getScriptVersion = function () { return '1'; }; + this.getScriptSnapshot = function (name) { return name === _this.filename ? _this.file : _this.lib; }; + this.getCurrentDirectory = function () { return ''; }; + this.getDefaultLibFileName = function () { return 'lib.d.ts'; }; + this.file = ts.ScriptSnapshot.fromString(contents); + this.lib = ts.ScriptSnapshot.fromString(''); + } + return SingleFileServiceHost; + }()); + nls_1.SingleFileServiceHost = SingleFileServiceHost; + function isCallExpressionWithinTextSpanCollectStep(textSpan, node) { + if (!ts.textSpanContainsTextSpan({ start: node.pos, length: node.end - node.pos }, textSpan)) { + return CollectStepResult.No; + } + return node.kind === 160 /* CallExpression */ ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; + } + function analyze(contents, options) { + if (options === void 0) { options = {}; } + var filename = 'file.ts'; + var serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents); + var service = ts.createLanguageService(serviceHost); + var sourceFile = service.getSourceFile(filename); + // all imports + var imports = lazy(collect(sourceFile, function (n) { return isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; })); + // import nls = require('vs/nls'); + var importEqualsDeclarations = imports + .filter(function (n) { return n.kind === 211 /* ImportEqualsDeclaration */; }) + .map(function (n) { return n; }) + .filter(function (d) { return d.moduleReference.kind === 222 /* ExternalModuleReference */; }) + .filter(function (d) { return d.moduleReference.expression.getText() === '\'vs/nls\''; }); + // import ... from 'vs/nls'; + var importDeclarations = imports + .filter(function (n) { return n.kind === 212 /* ImportDeclaration */; }) + .map(function (n) { return n; }) + .filter(function (d) { return d.moduleSpecifier.kind === 8 /* StringLiteral */; }) + .filter(function (d) { return d.moduleSpecifier.getText() === '\'vs/nls\''; }) + .filter(function (d) { return !!d.importClause && !!d.importClause.namedBindings; }); + var nlsExpressions = importEqualsDeclarations + .map(function (d) { return d.moduleReference.expression; }) + .concat(importDeclarations.map(function (d) { return d.moduleSpecifier; })) + .map(function (d) { return ({ + start: ts.getLineAndCharacterOfPosition(sourceFile, d.getStart()), + end: ts.getLineAndCharacterOfPosition(sourceFile, d.getEnd()) + }); }); + // `nls.localize(...)` calls + var nlsLocalizeCallExpressions = importDeclarations + .filter(function (d) { return d.importClause.namedBindings.kind === 214 /* NamespaceImport */; }) + .map(function (d) { return d.importClause.namedBindings.name; }) + .concat(importEqualsDeclarations.map(function (d) { return d.name; })) + .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) + .flatten() + .filter(function (r) { return !r.isWriteAccess; }) + .map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); }) + .map(function (a) { return lazy(a).last(); }) + .filter(function (n) { return !!n; }) + .map(function (n) { return n; }) + .filter(function (n) { return n.expression.kind === 158 /* PropertyAccessExpression */ && n.expression.name.getText() === 'localize'; }); + // `localize` named imports + var allLocalizeImportDeclarations = importDeclarations + .filter(function (d) { return d.importClause.namedBindings.kind === 215 /* NamedImports */; }) + .map(function (d) { return d.importClause.namedBindings.elements; }) + .flatten(); + // `localize` read-only references + var localizeReferences = allLocalizeImportDeclarations + .filter(function (d) { return d.name.getText() === 'localize'; }) + .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) + .flatten() + .filter(function (r) { return !r.isWriteAccess; }); + // custom named `localize` read-only references + var namedLocalizeReferences = allLocalizeImportDeclarations + .filter(function (d) { return d.propertyName && d.propertyName.getText() === 'localize'; }) + .map(function (n) { return service.getReferencesAtPosition(filename, n.name.pos + 1); }) + .flatten() + .filter(function (r) { return !r.isWriteAccess; }); + // find the deepest call expressions AST nodes that contain those references + var localizeCallExpressions = localizeReferences + .concat(namedLocalizeReferences) + .map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); }) + .map(function (a) { return lazy(a).last(); }) + .filter(function (n) { return !!n; }) + .map(function (n) { return n; }); + // collect everything + var localizeCalls = nlsLocalizeCallExpressions + .concat(localizeCallExpressions) + .map(function (e) { return e.arguments; }) + .filter(function (a) { return a.length > 1; }) + .sort(function (a, b) { return a[0].getStart() - b[0].getStart(); }) + .map(function (a) { return ({ + keySpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getEnd()) }, + key: a[0].getText(), + valueSpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getEnd()) }, + value: a[1].getText() + }); }); + return { + localizeCalls: localizeCalls.toArray(), + nlsExpressions: nlsExpressions.toArray() + }; + } + nls_1.analyze = analyze; + var TextModel = (function () { + function TextModel(contents) { + var regex = /\r\n|\r|\n/g; + var index = 0; + var match; + this.lines = []; + this.lineEndings = []; + while (match = regex.exec(contents)) { + this.lines.push(contents.substring(index, match.index)); + this.lineEndings.push(match[0]); + index = regex.lastIndex; + } + if (contents.length > 0) { + this.lines.push(contents.substring(index, contents.length)); + this.lineEndings.push(''); + } + } + TextModel.prototype.get = function (index) { + return this.lines[index]; + }; + TextModel.prototype.set = function (index, line) { + this.lines[index] = line; + }; + Object.defineProperty(TextModel.prototype, "lineCount", { + get: function () { + return this.lines.length; + }, + enumerable: true, + configurable: true + }); + /** + * Applies patch(es) to the model. + * Multiple patches must be ordered. + * Does not support patches spanning multiple lines. + */ + TextModel.prototype.apply = function (patch) { + var startLineNumber = patch.span.start.line; + var endLineNumber = patch.span.end.line; + var startLine = this.lines[startLineNumber] || ''; + var endLine = this.lines[endLineNumber] || ''; + this.lines[startLineNumber] = [ + startLine.substring(0, patch.span.start.character), + patch.content, + endLine.substring(patch.span.end.character) + ].join(''); + for (var i = startLineNumber + 1; i <= endLineNumber; i++) { + this.lines[i] = ''; + } + }; + TextModel.prototype.toString = function () { + return lazy(this.lines).zip(this.lineEndings) + .flatten().toArray().join(''); + }; + return TextModel; + }()); + nls_1.TextModel = TextModel; + function patchJavascript(patches, contents, moduleId) { + var model = new nls.TextModel(contents); + // patch the localize calls + lazy(patches).reverse().each(function (p) { return model.apply(p); }); + // patch the 'vs/nls' imports + var firstLine = model.get(0); + var patchedFirstLine = firstLine.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1"); + model.set(0, patchedFirstLine); + return model.toString(); + } + nls_1.patchJavascript = patchJavascript; + function patchSourcemap(patches, rsm, smc) { + var smg = new sm.SourceMapGenerator({ + file: rsm.file, + sourceRoot: rsm.sourceRoot + }); + patches = patches.reverse(); + var currentLine = -1; + var currentLineDiff = 0; + var source = null; + smc.eachMapping(function (m) { + var patch = patches[patches.length - 1]; + var original = { line: m.originalLine, column: m.originalColumn }; + var generated = { line: m.generatedLine, column: m.generatedColumn }; + if (currentLine !== generated.line) { + currentLineDiff = 0; + } + currentLine = generated.line; + generated.column += currentLineDiff; + if (patch && m.generatedLine - 1 === patch.span.end.line && m.generatedColumn === patch.span.end.character) { + var originalLength = patch.span.end.character - patch.span.start.character; + var modifiedLength = patch.content.length; + var lengthDiff = modifiedLength - originalLength; + currentLineDiff += lengthDiff; + generated.column += lengthDiff; + patches.pop(); + } + source = rsm.sourceRoot ? path.relative(rsm.sourceRoot, m.source) : m.source; + source = source.replace(/\\/g, '/'); + smg.addMapping({ source: source, name: m.name, original: original, generated: generated }); + }, null, sm.SourceMapConsumer.GENERATED_ORDER); + if (source) { + smg.setSourceContent(source, smc.sourceContentFor(source)); + } + return JSON.parse(smg.toString()); + } + nls_1.patchSourcemap = patchSourcemap; + function patch(moduleId, typescript, javascript, sourcemap) { + var _a = analyze(typescript), localizeCalls = _a.localizeCalls, nlsExpressions = _a.nlsExpressions; + if (localizeCalls.length === 0) { + return { javascript: javascript, sourcemap: sourcemap }; + } + var nlsKeys = template(localizeCalls.map(function (lc) { return lc.key; })); + var nls = template(localizeCalls.map(function (lc) { return lc.value; })); + var smc = new sm.SourceMapConsumer(sourcemap); + var positionFrom = mappedPositionFrom.bind(null, sourcemap.sources[0]); + var i = 0; + // build patches + var patches = lazy(localizeCalls) + .map(function (lc) { return ([ + { range: lc.keySpan, content: '' + (i++) }, + { range: lc.valueSpan, content: 'null' } + ]); }) + .flatten() + .map(function (c) { + var start = lcFrom(smc.generatedPositionFor(positionFrom(c.range.start))); + var end = lcFrom(smc.generatedPositionFor(positionFrom(c.range.end))); + return { span: { start: start, end: end }, content: c.content }; + }) + .toArray(); + javascript = patchJavascript(patches, javascript, moduleId); + // since imports are not within the sourcemap information, + // we must do this MacGyver style + if (nlsExpressions.length) { + javascript = javascript.replace(/^define\(.*$/m, function (line) { + return line.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1"); + }); + } + sourcemap = patchSourcemap(patches, sourcemap, smc); + return { javascript: javascript, sourcemap: sourcemap, nlsKeys: nlsKeys, nls: nls }; + } + nls_1.patch = patch; + function patchFiles(javascriptFile, typescript) { + // hack? + var moduleId = javascriptFile.relative + .replace(/\.js$/, '') + .replace(/\\/g, '/'); + var _a = patch(moduleId, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap), javascript = _a.javascript, sourcemap = _a.sourcemap, nlsKeys = _a.nlsKeys, nls = _a.nls; + var result = [fileFrom(javascriptFile, javascript)]; + result[0].sourceMap = sourcemap; + if (nlsKeys) { + result.push(fileFrom(javascriptFile, nlsKeys, javascriptFile.path.replace(/\.js$/, '.nls.keys.js'))); + } + if (nls) { + result.push(fileFrom(javascriptFile, nls, javascriptFile.path.replace(/\.js$/, '.nls.js'))); + } + return result; + } + nls_1.patchFiles = patchFiles; +})(nls || (nls = {})); +module.exports = nls; diff --git a/build/lib/optimize.js b/build/lib/optimize.js index 9ff371cda9a..d3bc1ee5c8c 100644 --- a/build/lib/optimize.js +++ b/build/lib/optimize.js @@ -1,235 +1,235 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -var path = require("path"); -var gulp = require("gulp"); -var sourcemaps = require("gulp-sourcemaps"); -var filter = require("gulp-filter"); -var minifyCSS = require("gulp-cssnano"); -var uglify = require("gulp-uglify"); -var es = require("event-stream"); -var concat = require("gulp-concat"); -var VinylFile = require("vinyl"); -var bundle = require("./bundle"); -var util = require("./util"); -var i18n = require("./i18n"); -var gulpUtil = require("gulp-util"); -var flatmap = require("gulp-flatmap"); -var pump = require("pump"); -var REPO_ROOT_PATH = path.join(__dirname, '../..'); -function log(prefix, message) { - gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message); -} -function loaderConfig(emptyPaths) { - var result = { - paths: { - 'vs': 'out-build/vs', - 'vscode': 'empty:' - }, - nodeModules: emptyPaths || [] - }; - result['vs/css'] = { inlineResources: true }; - return result; -} -exports.loaderConfig = loaderConfig; -var IS_OUR_COPYRIGHT_REGEXP = /Copyright \(C\) Microsoft Corporation/i; -function loader(bundledFileHeader, bundleLoader) { - var sources = [ - 'out-build/vs/loader.js' - ]; - if (bundleLoader) { - sources = sources.concat([ - 'out-build/vs/css.js', - 'out-build/vs/nls.js' - ]); - } - var isFirst = true; - return (gulp - .src(sources, { base: 'out-build' }) - .pipe(es.through(function (data) { - if (isFirst) { - isFirst = false; - this.emit('data', new VinylFile({ - path: 'fake', - base: '', - contents: new Buffer(bundledFileHeader) - })); - this.emit('data', data); - } - else { - this.emit('data', data); - } - })) - .pipe(util.loadSourcemaps()) - .pipe(concat('vs/loader.js')) - .pipe(es.mapSync(function (f) { - f.sourceMap.sourceRoot = util.toFileUri(path.join(REPO_ROOT_PATH, 'src')); - return f; - }))); -} -function toConcatStream(bundledFileHeader, sources, dest) { - var useSourcemaps = /\.js$/.test(dest) && !/\.nls\.js$/.test(dest); - // If a bundle ends up including in any of the sources our copyright, then - // insert a fake source at the beginning of each bundle with our copyright - var containsOurCopyright = false; - for (var i = 0, len = sources.length; i < len; i++) { - var fileContents = sources[i].contents; - if (IS_OUR_COPYRIGHT_REGEXP.test(fileContents)) { - containsOurCopyright = true; - break; - } - } - if (containsOurCopyright) { - sources.unshift({ - path: null, - contents: bundledFileHeader - }); - } - var treatedSources = sources.map(function (source) { - var root = source.path ? REPO_ROOT_PATH.replace(/\\/g, '/') : ''; - var base = source.path ? root + '/out-build' : ''; - return new VinylFile({ - path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake', - base: base, - contents: new Buffer(source.contents) - }); - }); - return es.readArray(treatedSources) - .pipe(useSourcemaps ? util.loadSourcemaps() : es.through()) - .pipe(concat(dest)); -} -function toBundleStream(bundledFileHeader, bundles) { - return es.merge(bundles.map(function (bundle) { - return toConcatStream(bundledFileHeader, bundle.sources, bundle.dest); - })); -} -function optimizeTask(opts) { - var entryPoints = opts.entryPoints; - var otherSources = opts.otherSources; - var resources = opts.resources; - var loaderConfig = opts.loaderConfig; - var bundledFileHeader = opts.header; - var bundleLoader = (typeof opts.bundleLoader === 'undefined' ? true : opts.bundleLoader); - var out = opts.out; - return function () { - var bundlesStream = es.through(); // this stream will contain the bundled files - var resourcesStream = es.through(); // this stream will contain the resources - var bundleInfoStream = es.through(); // this stream will contain bundleInfo.json - bundle.bundle(entryPoints, loaderConfig, function (err, result) { - if (err) { - return bundlesStream.emit('error', JSON.stringify(err)); - } - toBundleStream(bundledFileHeader, result.files).pipe(bundlesStream); - // Remove css inlined resources - var filteredResources = resources.slice(); - result.cssInlinedResources.forEach(function (resource) { - if (process.env['VSCODE_BUILD_VERBOSE']) { - log('optimizer', 'excluding inlined: ' + resource); - } - filteredResources.push('!' + resource); - }); - gulp.src(filteredResources, { base: 'out-build' }).pipe(resourcesStream); - var bundleInfoArray = []; - if (opts.bundleInfo) { - bundleInfoArray.push(new VinylFile({ - path: 'bundleInfo.json', - base: '.', - contents: new Buffer(JSON.stringify(result.bundleData, null, '\t')) - })); - } - es.readArray(bundleInfoArray).pipe(bundleInfoStream); - }); - var otherSourcesStream = es.through(); - var otherSourcesStreamArr = []; - gulp.src(otherSources, { base: 'out-build' }) - .pipe(es.through(function (data) { - otherSourcesStreamArr.push(toConcatStream(bundledFileHeader, [data], data.relative)); - }, function () { - if (!otherSourcesStreamArr.length) { - setTimeout(function () { otherSourcesStream.emit('end'); }, 0); - } - else { - es.merge(otherSourcesStreamArr).pipe(otherSourcesStream); - } - })); - var result = es.merge(loader(bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream); - return result - .pipe(sourcemaps.write('./', { - sourceRoot: null, - addComment: true, - includeContent: true - })) - .pipe(i18n.processNlsFiles({ - fileHeader: bundledFileHeader - })) - .pipe(gulp.dest(out)); - }; -} -exports.optimizeTask = optimizeTask; -; -/** - * Wrap around uglify and allow the preserveComments function - * to have a file "context" to include our copyright only once per file. - */ -function uglifyWithCopyrights() { - var preserveComments = function (f) { - return function (node, comment) { - var text = comment.value; - var type = comment.type; - if (/@minifier_do_not_preserve/.test(text)) { - return false; - } - var isOurCopyright = IS_OUR_COPYRIGHT_REGEXP.test(text); - if (isOurCopyright) { - if (f.__hasOurCopyright) { - return false; - } - f.__hasOurCopyright = true; - return true; - } - if ('comment2' === type) { - // check for /*!. Note that text doesn't contain leading /* - return (text.length > 0 && text[0] === '!') || /@preserve|license|@cc_on|copyright/i.test(text); - } - else if ('comment1' === type) { - return /license|copyright/i.test(text); - } - return false; - }; - }; - var input = es.through(); - var output = input - .pipe(flatmap(function (stream, f) { - return stream.pipe(uglify({ - preserveComments: preserveComments(f), - output: { - // linux tfs build agent is crashing, does this help?§ - max_line_len: 3200000 - } - })); - })); - return es.duplex(input, output); -} -function minifyTask(src, sourceMapBaseUrl) { - var sourceMappingURL = sourceMapBaseUrl && (function (f) { return sourceMapBaseUrl + "/" + f.relative + ".map"; }); - return function (cb) { - var jsFilter = filter('**/*.js', { restore: true }); - var cssFilter = filter('**/*.css', { restore: true }); - pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', { - sourceMappingURL: sourceMappingURL, - sourceRoot: null, - includeContent: true, - addComment: true - }), gulp.dest(src + '-min'), function (err) { - if (err instanceof uglify.GulpUglifyError) { - console.error("Uglify error in '" + (err.cause && err.cause.filename) + "'"); - } - cb(err); - }); - }; -} -exports.minifyTask = minifyTask; -; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var gulp = require("gulp"); +var sourcemaps = require("gulp-sourcemaps"); +var filter = require("gulp-filter"); +var minifyCSS = require("gulp-cssnano"); +var uglify = require("gulp-uglify"); +var es = require("event-stream"); +var concat = require("gulp-concat"); +var VinylFile = require("vinyl"); +var bundle = require("./bundle"); +var util = require("./util"); +var i18n = require("./i18n"); +var gulpUtil = require("gulp-util"); +var flatmap = require("gulp-flatmap"); +var pump = require("pump"); +var REPO_ROOT_PATH = path.join(__dirname, '../..'); +function log(prefix, message) { + gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message); +} +function loaderConfig(emptyPaths) { + var result = { + paths: { + 'vs': 'out-build/vs', + 'vscode': 'empty:' + }, + nodeModules: emptyPaths || [] + }; + result['vs/css'] = { inlineResources: true }; + return result; +} +exports.loaderConfig = loaderConfig; +var IS_OUR_COPYRIGHT_REGEXP = /Copyright \(C\) Microsoft Corporation/i; +function loader(bundledFileHeader, bundleLoader) { + var sources = [ + 'out-build/vs/loader.js' + ]; + if (bundleLoader) { + sources = sources.concat([ + 'out-build/vs/css.js', + 'out-build/vs/nls.js' + ]); + } + var isFirst = true; + return (gulp + .src(sources, { base: 'out-build' }) + .pipe(es.through(function (data) { + if (isFirst) { + isFirst = false; + this.emit('data', new VinylFile({ + path: 'fake', + base: '', + contents: new Buffer(bundledFileHeader) + })); + this.emit('data', data); + } + else { + this.emit('data', data); + } + })) + .pipe(util.loadSourcemaps()) + .pipe(concat('vs/loader.js')) + .pipe(es.mapSync(function (f) { + f.sourceMap.sourceRoot = util.toFileUri(path.join(REPO_ROOT_PATH, 'src')); + return f; + }))); +} +function toConcatStream(bundledFileHeader, sources, dest) { + var useSourcemaps = /\.js$/.test(dest) && !/\.nls\.js$/.test(dest); + // If a bundle ends up including in any of the sources our copyright, then + // insert a fake source at the beginning of each bundle with our copyright + var containsOurCopyright = false; + for (var i = 0, len = sources.length; i < len; i++) { + var fileContents = sources[i].contents; + if (IS_OUR_COPYRIGHT_REGEXP.test(fileContents)) { + containsOurCopyright = true; + break; + } + } + if (containsOurCopyright) { + sources.unshift({ + path: null, + contents: bundledFileHeader + }); + } + var treatedSources = sources.map(function (source) { + var root = source.path ? REPO_ROOT_PATH.replace(/\\/g, '/') : ''; + var base = source.path ? root + '/out-build' : ''; + return new VinylFile({ + path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake', + base: base, + contents: new Buffer(source.contents) + }); + }); + return es.readArray(treatedSources) + .pipe(useSourcemaps ? util.loadSourcemaps() : es.through()) + .pipe(concat(dest)); +} +function toBundleStream(bundledFileHeader, bundles) { + return es.merge(bundles.map(function (bundle) { + return toConcatStream(bundledFileHeader, bundle.sources, bundle.dest); + })); +} +function optimizeTask(opts) { + var entryPoints = opts.entryPoints; + var otherSources = opts.otherSources; + var resources = opts.resources; + var loaderConfig = opts.loaderConfig; + var bundledFileHeader = opts.header; + var bundleLoader = (typeof opts.bundleLoader === 'undefined' ? true : opts.bundleLoader); + var out = opts.out; + return function () { + var bundlesStream = es.through(); // this stream will contain the bundled files + var resourcesStream = es.through(); // this stream will contain the resources + var bundleInfoStream = es.through(); // this stream will contain bundleInfo.json + bundle.bundle(entryPoints, loaderConfig, function (err, result) { + if (err) { + return bundlesStream.emit('error', JSON.stringify(err)); + } + toBundleStream(bundledFileHeader, result.files).pipe(bundlesStream); + // Remove css inlined resources + var filteredResources = resources.slice(); + result.cssInlinedResources.forEach(function (resource) { + if (process.env['VSCODE_BUILD_VERBOSE']) { + log('optimizer', 'excluding inlined: ' + resource); + } + filteredResources.push('!' + resource); + }); + gulp.src(filteredResources, { base: 'out-build' }).pipe(resourcesStream); + var bundleInfoArray = []; + if (opts.bundleInfo) { + bundleInfoArray.push(new VinylFile({ + path: 'bundleInfo.json', + base: '.', + contents: new Buffer(JSON.stringify(result.bundleData, null, '\t')) + })); + } + es.readArray(bundleInfoArray).pipe(bundleInfoStream); + }); + var otherSourcesStream = es.through(); + var otherSourcesStreamArr = []; + gulp.src(otherSources, { base: 'out-build' }) + .pipe(es.through(function (data) { + otherSourcesStreamArr.push(toConcatStream(bundledFileHeader, [data], data.relative)); + }, function () { + if (!otherSourcesStreamArr.length) { + setTimeout(function () { otherSourcesStream.emit('end'); }, 0); + } + else { + es.merge(otherSourcesStreamArr).pipe(otherSourcesStream); + } + })); + var result = es.merge(loader(bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream); + return result + .pipe(sourcemaps.write('./', { + sourceRoot: null, + addComment: true, + includeContent: true + })) + .pipe(i18n.processNlsFiles({ + fileHeader: bundledFileHeader + })) + .pipe(gulp.dest(out)); + }; +} +exports.optimizeTask = optimizeTask; +; +/** + * Wrap around uglify and allow the preserveComments function + * to have a file "context" to include our copyright only once per file. + */ +function uglifyWithCopyrights() { + var preserveComments = function (f) { + return function (node, comment) { + var text = comment.value; + var type = comment.type; + if (/@minifier_do_not_preserve/.test(text)) { + return false; + } + var isOurCopyright = IS_OUR_COPYRIGHT_REGEXP.test(text); + if (isOurCopyright) { + if (f.__hasOurCopyright) { + return false; + } + f.__hasOurCopyright = true; + return true; + } + if ('comment2' === type) { + // check for /*!. Note that text doesn't contain leading /* + return (text.length > 0 && text[0] === '!') || /@preserve|license|@cc_on|copyright/i.test(text); + } + else if ('comment1' === type) { + return /license|copyright/i.test(text); + } + return false; + }; + }; + var input = es.through(); + var output = input + .pipe(flatmap(function (stream, f) { + return stream.pipe(uglify({ + preserveComments: preserveComments(f), + output: { + // linux tfs build agent is crashing, does this help?§ + max_line_len: 3200000 + } + })); + })); + return es.duplex(input, output); +} +function minifyTask(src, sourceMapBaseUrl) { + var sourceMappingURL = sourceMapBaseUrl && (function (f) { return sourceMapBaseUrl + "/" + f.relative + ".map"; }); + return function (cb) { + var jsFilter = filter('**/*.js', { restore: true }); + var cssFilter = filter('**/*.css', { restore: true }); + pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', { + sourceMappingURL: sourceMappingURL, + sourceRoot: null, + includeContent: true, + addComment: true + }), gulp.dest(src + '-min'), function (err) { + if (err instanceof uglify.GulpUglifyError) { + console.error("Uglify error in '" + (err.cause && err.cause.filename) + "'"); + } + cb(err); + }); + }; +} +exports.minifyTask = minifyTask; +; diff --git a/build/lib/reporter.js b/build/lib/reporter.js index e7eb9fc2aa5..a1df81a6573 100644 --- a/build/lib/reporter.js +++ b/build/lib/reporter.js @@ -1,83 +1,83 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -var es = require("event-stream"); -var _ = require("underscore"); -var util = require("gulp-util"); -var fs = require("fs"); -var path = require("path"); -var allErrors = []; -var startTime = null; -var count = 0; -function onStart() { - if (count++ > 0) { - return; - } - startTime = new Date().getTime(); - util.log("Starting " + util.colors.green('compilation') + "..."); -} -function onEnd() { - if (--count > 0) { - return; - } - log(); -} -var buildLogPath = path.join(path.dirname(path.dirname(__dirname)), '.build', 'log'); -try { - fs.mkdirSync(path.dirname(buildLogPath)); -} -catch (err) { - // ignore -} -function log() { - var errors = _.flatten(allErrors); - errors.map(function (err) { return util.log(util.colors.red('Error') + ": " + err); }); - var regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/; - var messages = errors - .map(function (err) { return regex.exec(err); }) - .filter(function (match) { return !!match; }) - .map(function (_a) { - var path = _a[1], line = _a[2], column = _a[3], message = _a[4]; - return ({ path: path, line: Number.parseInt(line), column: Number.parseInt(column), message: message }); - }); - try { - fs.writeFileSync(buildLogPath, JSON.stringify(messages)); - } - catch (err) { - //noop - } - util.log("Finished " + util.colors.green('compilation') + " with " + errors.length + " errors after " + util.colors.magenta((new Date().getTime() - startTime) + ' ms')); -} -function createReporter() { - var errors = []; - allErrors.push(errors); - var ReportFunc = (function () { - function ReportFunc(err) { - errors.push(err); - } - ReportFunc.hasErrors = function () { - return errors.length > 0; - }; - ReportFunc.end = function (emitError) { - errors.length = 0; - onStart(); - return es.through(null, function () { - onEnd(); - if (emitError && errors.length > 0) { - log(); - this.emit('error'); - } - else { - this.emit('end'); - } - }); - }; - return ReportFunc; - }()); - return ReportFunc; -} -exports.createReporter = createReporter; -; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +var es = require("event-stream"); +var _ = require("underscore"); +var util = require("gulp-util"); +var fs = require("fs"); +var path = require("path"); +var allErrors = []; +var startTime = null; +var count = 0; +function onStart() { + if (count++ > 0) { + return; + } + startTime = new Date().getTime(); + util.log("Starting " + util.colors.green('compilation') + "..."); +} +function onEnd() { + if (--count > 0) { + return; + } + log(); +} +var buildLogPath = path.join(path.dirname(path.dirname(__dirname)), '.build', 'log'); +try { + fs.mkdirSync(path.dirname(buildLogPath)); +} +catch (err) { + // ignore +} +function log() { + var errors = _.flatten(allErrors); + errors.map(function (err) { return util.log(util.colors.red('Error') + ": " + err); }); + var regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/; + var messages = errors + .map(function (err) { return regex.exec(err); }) + .filter(function (match) { return !!match; }) + .map(function (_a) { + var path = _a[1], line = _a[2], column = _a[3], message = _a[4]; + return ({ path: path, line: parseInt(line), column: parseInt(column), message: message }); + }); + try { + fs.writeFileSync(buildLogPath, JSON.stringify(messages)); + } + catch (err) { + //noop + } + util.log("Finished " + util.colors.green('compilation') + " with " + errors.length + " errors after " + util.colors.magenta((new Date().getTime() - startTime) + ' ms')); +} +function createReporter() { + var errors = []; + allErrors.push(errors); + var ReportFunc = (function () { + function ReportFunc(err) { + errors.push(err); + } + ReportFunc.hasErrors = function () { + return errors.length > 0; + }; + ReportFunc.end = function (emitError) { + errors.length = 0; + onStart(); + return es.through(null, function () { + onEnd(); + if (emitError && errors.length > 0) { + log(); + this.emit('error'); + } + else { + this.emit('end'); + } + }); + }; + return ReportFunc; + }()); + return ReportFunc; +} +exports.createReporter = createReporter; +; diff --git a/build/lib/reporter.ts b/build/lib/reporter.ts index a61db941289..e072a60bbfd 100644 --- a/build/lib/reporter.ts +++ b/build/lib/reporter.ts @@ -48,7 +48,7 @@ function log(): void { const messages = errors .map(err => regex.exec(err)) .filter(match => !!match) - .map(([, path, line, column, message]) => ({ path, line: Number.parseInt(line), column: Number.parseInt(column), message })); + .map(([, path, line, column, message]) => ({ path, line: parseInt(line), column: parseInt(column), message })); try { diff --git a/build/lib/test/i18n.test.js b/build/lib/test/i18n.test.js index 03f84214b8c..17d5a3fcbf9 100644 --- a/build/lib/test/i18n.test.js +++ b/build/lib/test/i18n.test.js @@ -1,40 +1,40 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var assert = require("assert"); -var i18n = require("../i18n"); -suite('XLF Parser Tests', function () { - var sampleXlf = 'Key #1Key #2 &'; - var sampleTranslatedXlf = 'Key #1Кнопка #1Key #2 &Кнопка #2 &'; - var originalFilePath = 'vs/base/common/keybinding'; - var keys = ['key1', 'key2']; - var messages = ['Key #1', 'Key #2 &']; - var translatedMessages = { key1: 'Кнопка #1', key2: 'Кнопка #2 &' }; - test('Keys & messages to XLF conversion', function () { - var xlf = new i18n.XLF('vscode-workbench'); - xlf.addFile(originalFilePath, keys, messages); - var xlfString = xlf.toString(); - assert.strictEqual(xlfString.replace(/\s{2,}/g, ''), sampleXlf); - }); - test('XLF to keys & messages conversion', function () { - i18n.XLF.parse(sampleTranslatedXlf).then(function (resolvedFiles) { - assert.deepEqual(resolvedFiles[0].messages, translatedMessages); - assert.strictEqual(resolvedFiles[0].originalFilePath, originalFilePath); - }); - }); - test('JSON file source path to Transifex resource match', function () { - var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench'; - var platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject }; - assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform); - assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib); - assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor); - assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base); - assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code); - assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts); - assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices); - assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench); - }); -}); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); +var assert = require("assert"); +var i18n = require("../i18n"); +suite('XLF Parser Tests', function () { + var sampleXlf = 'Key #1Key #2 &'; + var sampleTranslatedXlf = 'Key #1Кнопка #1Key #2 &Кнопка #2 &'; + var originalFilePath = 'vs/base/common/keybinding'; + var keys = ['key1', 'key2']; + var messages = ['Key #1', 'Key #2 &']; + var translatedMessages = { key1: 'Кнопка #1', key2: 'Кнопка #2 &' }; + test('Keys & messages to XLF conversion', function () { + var xlf = new i18n.XLF('vscode-workbench'); + xlf.addFile(originalFilePath, keys, messages); + var xlfString = xlf.toString(); + assert.strictEqual(xlfString.replace(/\s{2,}/g, ''), sampleXlf); + }); + test('XLF to keys & messages conversion', function () { + i18n.XLF.parse(sampleTranslatedXlf).then(function (resolvedFiles) { + assert.deepEqual(resolvedFiles[0].messages, translatedMessages); + assert.strictEqual(resolvedFiles[0].originalFilePath, originalFilePath); + }); + }); + test('JSON file source path to Transifex resource match', function () { + var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench'; + var platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject }; + assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform); + assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib); + assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor); + assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base); + assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code); + assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts); + assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices); + assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench); + }); +}); diff --git a/build/lib/tslint/allowAsyncRule.js b/build/lib/tslint/allowAsyncRule.js index cdd121e00db..ee2a652e3c9 100644 --- a/build/lib/tslint/allowAsyncRule.js +++ b/build/lib/tslint/allowAsyncRule.js @@ -1,59 +1,59 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var ts = require("typescript"); -var Lint = require("tslint"); -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - var allowed = this.getOptions().ruleArguments[0]; - return this.applyWithWalker(new AsyncRuleWalker(sourceFile, this.getOptions(), allowed)); - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -var AsyncRuleWalker = (function (_super) { - __extends(AsyncRuleWalker, _super); - function AsyncRuleWalker(file, opts, allowed) { - var _this = _super.call(this, file, opts) || this; - _this.allowed = allowed; - return _this; - } - AsyncRuleWalker.prototype.visitMethodDeclaration = function (node) { - this.visitFunctionLikeDeclaration(node); - }; - AsyncRuleWalker.prototype.visitFunctionDeclaration = function (node) { - this.visitFunctionLikeDeclaration(node); - }; - AsyncRuleWalker.prototype.visitFunctionLikeDeclaration = function (node) { - var _this = this; - var flags = ts.getCombinedModifierFlags(node); - if (!(flags & ts.ModifierFlags.Async)) { - return; - } - var path = node.getSourceFile().path; - var pathParts = path.split(/\\|\//); - if (pathParts.some(function (part) { return _this.allowed.some(function (allowed) { return part === allowed; }); })) { - return; - } - var message = "You are not allowed to use async function in this layer. Allowed layers are: [" + this.allowed + "]"; - this.addFailureAtNode(node, message); - }; - return AsyncRuleWalker; -}(Lint.RuleWalker)); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ts = require("typescript"); +var Lint = require("tslint"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + var allowed = this.getOptions().ruleArguments[0]; + return this.applyWithWalker(new AsyncRuleWalker(sourceFile, this.getOptions(), allowed)); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var AsyncRuleWalker = (function (_super) { + __extends(AsyncRuleWalker, _super); + function AsyncRuleWalker(file, opts, allowed) { + var _this = _super.call(this, file, opts) || this; + _this.allowed = allowed; + return _this; + } + AsyncRuleWalker.prototype.visitMethodDeclaration = function (node) { + this.visitFunctionLikeDeclaration(node); + }; + AsyncRuleWalker.prototype.visitFunctionDeclaration = function (node) { + this.visitFunctionLikeDeclaration(node); + }; + AsyncRuleWalker.prototype.visitFunctionLikeDeclaration = function (node) { + var _this = this; + var flags = ts.getCombinedModifierFlags(node); + if (!(flags & ts.ModifierFlags.Async)) { + return; + } + var path = node.getSourceFile().path; + var pathParts = path.split(/\\|\//); + if (pathParts.some(function (part) { return _this.allowed.some(function (allowed) { return part === allowed; }); })) { + return; + } + var message = "You are not allowed to use async function in this layer. Allowed layers are: [" + this.allowed + "]"; + this.addFailureAtNode(node, message); + }; + return AsyncRuleWalker; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/allowAsyncRule.ts b/build/lib/tslint/allowAsyncRule.ts index 6506929cb9b..e61765bf53d 100644 --- a/build/lib/tslint/allowAsyncRule.ts +++ b/build/lib/tslint/allowAsyncRule.ts @@ -34,7 +34,7 @@ class AsyncRuleWalker extends Lint.RuleWalker { return; } - const path = node.getSourceFile().path; + const path = (node.getSourceFile() as any).path; const pathParts = path.split(/\\|\//); if (pathParts.some(part => this.allowed.some(allowed => part === allowed))) { diff --git a/build/lib/tslint/duplicateImportsRule.js b/build/lib/tslint/duplicateImportsRule.js index d63cb42a5d2..c3e96b8e412 100644 --- a/build/lib/tslint/duplicateImportsRule.js +++ b/build/lib/tslint/duplicateImportsRule.js @@ -1,50 +1,50 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var path_1 = require("path"); -var Lint = require("tslint"); -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions())); - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -var ImportPatterns = (function (_super) { - __extends(ImportPatterns, _super); - function ImportPatterns(file, opts) { - var _this = _super.call(this, file, opts) || this; - _this.imports = Object.create(null); - return _this; - } - ImportPatterns.prototype.visitImportDeclaration = function (node) { - var path = node.moduleSpecifier.getText(); - // remove quotes - path = path.slice(1, -1); - if (path[0] === '.') { - path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); - } - if (this.imports[path]) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Duplicate imports for '" + path + "'.")); - } - this.imports[path] = true; - }; - return ImportPatterns; -}(Lint.RuleWalker)); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var path_1 = require("path"); +var Lint = require("tslint"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions())); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var ImportPatterns = (function (_super) { + __extends(ImportPatterns, _super); + function ImportPatterns(file, opts) { + var _this = _super.call(this, file, opts) || this; + _this.imports = Object.create(null); + return _this; + } + ImportPatterns.prototype.visitImportDeclaration = function (node) { + var path = node.moduleSpecifier.getText(); + // remove quotes + path = path.slice(1, -1); + if (path[0] === '.') { + path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); + } + if (this.imports[path]) { + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Duplicate imports for '" + path + "'.")); + } + this.imports[path] = true; + }; + return ImportPatterns; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/importPatternsRule.js b/build/lib/tslint/importPatternsRule.js index f79ffca6165..6bd94309cf8 100644 --- a/build/lib/tslint/importPatternsRule.js +++ b/build/lib/tslint/importPatternsRule.js @@ -1,57 +1,57 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var Lint = require("tslint"); -var minimatch = require("minimatch"); -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - var configs = this.getOptions().ruleArguments; - for (var _i = 0, configs_1 = configs; _i < configs_1.length; _i++) { - var config = configs_1[_i]; - if (minimatch(sourceFile.fileName, config.target)) { - return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions(), config)); - } - } - return []; - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -var ImportPatterns = (function (_super) { - __extends(ImportPatterns, _super); - function ImportPatterns(file, opts, _config) { - var _this = _super.call(this, file, opts) || this; - _this._config = _config; - return _this; - } - ImportPatterns.prototype.visitImportDeclaration = function (node) { - var path = node.moduleSpecifier.getText(); - // remove quotes - path = path.slice(1, -1); - // ignore relative paths - if (path[0] === '.') { - return; - } - if (!minimatch(path, this._config.restrictions)) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Imports violates '" + this._config.restrictions + "'-restriction.")); - } - }; - return ImportPatterns; -}(Lint.RuleWalker)); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var Lint = require("tslint"); +var minimatch = require("minimatch"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + var configs = this.getOptions().ruleArguments; + for (var _i = 0, configs_1 = configs; _i < configs_1.length; _i++) { + var config = configs_1[_i]; + if (minimatch(sourceFile.fileName, config.target)) { + return this.applyWithWalker(new ImportPatterns(sourceFile, this.getOptions(), config)); + } + } + return []; + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var ImportPatterns = (function (_super) { + __extends(ImportPatterns, _super); + function ImportPatterns(file, opts, _config) { + var _this = _super.call(this, file, opts) || this; + _this._config = _config; + return _this; + } + ImportPatterns.prototype.visitImportDeclaration = function (node) { + var path = node.moduleSpecifier.getText(); + // remove quotes + path = path.slice(1, -1); + // ignore relative paths + if (path[0] === '.') { + return; + } + if (!minimatch(path, this._config.restrictions)) { + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Imports violates '" + this._config.restrictions + "'-restriction.")); + } + }; + return ImportPatterns; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/layeringRule.js b/build/lib/tslint/layeringRule.js index 0d5b3771e3c..37a60b2b44f 100644 --- a/build/lib/tslint/layeringRule.js +++ b/build/lib/tslint/layeringRule.js @@ -1,85 +1,85 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var Lint = require("tslint"); -var path_1 = require("path"); -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - var parts = path_1.dirname(sourceFile.fileName).split(/\\|\//); - var ruleArgs = this.getOptions().ruleArguments[0]; - var config; - for (var i = parts.length - 1; i >= 0; i--) { - if (ruleArgs[parts[i]]) { - config = { - allowed: new Set(ruleArgs[parts[i]]).add(parts[i]), - disallowed: new Set() - }; - Object.keys(ruleArgs).forEach(function (key) { - if (!config.allowed.has(key)) { - config.disallowed.add(key); - } - }); - break; - } - } - if (!config) { - return []; - } - return this.applyWithWalker(new LayeringRule(sourceFile, config, this.getOptions())); - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -var LayeringRule = (function (_super) { - __extends(LayeringRule, _super); - function LayeringRule(file, config, opts) { - var _this = _super.call(this, file, opts) || this; - _this._config = config; - return _this; - } - LayeringRule.prototype.visitImportDeclaration = function (node) { - var path = node.moduleSpecifier.getText(); - // remove quotes - path = path.slice(1, -1); - if (path[0] === '.') { - path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); - } - var parts = path_1.dirname(path).split(/\\|\//); - for (var i = parts.length - 1; i >= 0; i--) { - var part = parts[i]; - if (this._config.allowed.has(part)) { - // GOOD - same layer - return; - } - if (this._config.disallowed.has(part)) { - // BAD - wrong layer - var message = "Bad layering. You are not allowed to access '" + part + "' from here, allowed layers are: [" + LayeringRule._print(this._config.allowed) + "]"; - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), message)); - return; - } - } - }; - LayeringRule._print = function (set) { - var r = []; - set.forEach(function (e) { return r.push(e); }); - return r.join(', '); - }; - return LayeringRule; -}(Lint.RuleWalker)); +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var Lint = require("tslint"); +var path_1 = require("path"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + var parts = path_1.dirname(sourceFile.fileName).split(/\\|\//); + var ruleArgs = this.getOptions().ruleArguments[0]; + var config; + for (var i = parts.length - 1; i >= 0; i--) { + if (ruleArgs[parts[i]]) { + config = { + allowed: new Set(ruleArgs[parts[i]]).add(parts[i]), + disallowed: new Set() + }; + Object.keys(ruleArgs).forEach(function (key) { + if (!config.allowed.has(key)) { + config.disallowed.add(key); + } + }); + break; + } + } + if (!config) { + return []; + } + return this.applyWithWalker(new LayeringRule(sourceFile, config, this.getOptions())); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var LayeringRule = (function (_super) { + __extends(LayeringRule, _super); + function LayeringRule(file, config, opts) { + var _this = _super.call(this, file, opts) || this; + _this._config = config; + return _this; + } + LayeringRule.prototype.visitImportDeclaration = function (node) { + var path = node.moduleSpecifier.getText(); + // remove quotes + path = path.slice(1, -1); + if (path[0] === '.') { + path = path_1.join(path_1.dirname(node.getSourceFile().fileName), path); + } + var parts = path_1.dirname(path).split(/\\|\//); + for (var i = parts.length - 1; i >= 0; i--) { + var part = parts[i]; + if (this._config.allowed.has(part)) { + // GOOD - same layer + return; + } + if (this._config.disallowed.has(part)) { + // BAD - wrong layer + var message = "Bad layering. You are not allowed to access '" + part + "' from here, allowed layers are: [" + LayeringRule._print(this._config.allowed) + "]"; + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), message)); + return; + } + } + }; + LayeringRule._print = function (set) { + var r = []; + set.forEach(function (e) { return r.push(e); }); + return r.join(', '); + }; + return LayeringRule; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/noUnexternalizedStringsRule.js b/build/lib/tslint/noUnexternalizedStringsRule.js index 657c5f8a870..db189931465 100644 --- a/build/lib/tslint/noUnexternalizedStringsRule.js +++ b/build/lib/tslint/noUnexternalizedStringsRule.js @@ -1,177 +1,177 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var ts = require("typescript"); -var Lint = require("tslint"); -/** - * Implementation of the no-unexternalized-strings rule. - */ -var Rule = (function (_super) { - __extends(Rule, _super); - function Rule() { - return _super !== null && _super.apply(this, arguments) || this; - } - Rule.prototype.apply = function (sourceFile) { - return this.applyWithWalker(new NoUnexternalizedStringsRuleWalker(sourceFile, this.getOptions())); - }; - return Rule; -}(Lint.Rules.AbstractRule)); -exports.Rule = Rule; -function isStringLiteral(node) { - return node && node.kind === ts.SyntaxKind.StringLiteral; -} -function isObjectLiteral(node) { - return node && node.kind === ts.SyntaxKind.ObjectLiteralExpression; -} -function isPropertyAssignment(node) { - return node && node.kind === ts.SyntaxKind.PropertyAssignment; -} -var NoUnexternalizedStringsRuleWalker = (function (_super) { - __extends(NoUnexternalizedStringsRuleWalker, _super); - function NoUnexternalizedStringsRuleWalker(file, opts) { - var _this = _super.call(this, file, opts) || this; - _this.signatures = Object.create(null); - _this.ignores = Object.create(null); - _this.messageIndex = undefined; - _this.keyIndex = undefined; - _this.usedKeys = Object.create(null); - var options = _this.getOptions(); - var first = options && options.length > 0 ? options[0] : null; - if (first) { - if (Array.isArray(first.signatures)) { - first.signatures.forEach(function (signature) { return _this.signatures[signature] = true; }); - } - if (Array.isArray(first.ignores)) { - first.ignores.forEach(function (ignore) { return _this.ignores[ignore] = true; }); - } - if (typeof first.messageIndex !== 'undefined') { - _this.messageIndex = first.messageIndex; - } - if (typeof first.keyIndex !== 'undefined') { - _this.keyIndex = first.keyIndex; - } - } - return _this; - } - NoUnexternalizedStringsRuleWalker.prototype.visitSourceFile = function (node) { - var _this = this; - _super.prototype.visitSourceFile.call(this, node); - Object.keys(this.usedKeys).forEach(function (key) { - var occurences = _this.usedKeys[key]; - if (occurences.length > 1) { - occurences.forEach(function (occurence) { - _this.addFailure((_this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), "Duplicate key " + occurence.key.getText() + " with different message value."))); - }); - } - }); - }; - NoUnexternalizedStringsRuleWalker.prototype.visitStringLiteral = function (node) { - this.checkStringLiteral(node); - _super.prototype.visitStringLiteral.call(this, node); - }; - NoUnexternalizedStringsRuleWalker.prototype.checkStringLiteral = function (node) { - var text = node.getText(); - var doubleQuoted = text.length >= 2 && text[0] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE && text[text.length - 1] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE; - var info = this.findDescribingParent(node); - // Ignore strings in import and export nodes. - if (info && info.ignoreUsage) { - return; - } - var callInfo = info ? info.callInfo : null; - var functionName = callInfo ? callInfo.callExpression.expression.getText() : null; - if (functionName && this.ignores[functionName]) { - return; - } - if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) { - var s = node.getText(); - var replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")"); - var fix = new Lint.Fix('Unexternalitzed string', [replacement]); - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Unexternalized string found: " + node.getText(), fix)); - return; - } - // We have a single quoted string outside a localize function name. - if (!doubleQuoted && !this.signatures[functionName]) { - return; - } - // We have a string that is a direct argument into the localize call. - var keyArg = callInfo.argIndex === this.keyIndex - ? callInfo.callExpression.arguments[this.keyIndex] - : null; - if (keyArg) { - if (isStringLiteral(keyArg)) { - this.recordKey(keyArg, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined); - } - else if (isObjectLiteral(keyArg)) { - for (var i = 0; i < keyArg.properties.length; i++) { - var property = keyArg.properties[i]; - if (isPropertyAssignment(property)) { - var name_1 = property.name.getText(); - if (name_1 === 'key') { - var initializer = property.initializer; - if (isStringLiteral(initializer)) { - this.recordKey(initializer, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined); - } - break; - } - } - } - } - } - var messageArg = callInfo.argIndex === this.messageIndex - ? callInfo.callExpression.arguments[this.messageIndex] - : null; - if (messageArg && messageArg !== node) { - this.addFailure(this.createFailure(messageArg.getStart(), messageArg.getWidth(), "Message argument to '" + callInfo.callExpression.expression.getText() + "' must be a string literal.")); - return; - } - }; - NoUnexternalizedStringsRuleWalker.prototype.recordKey = function (keyNode, messageNode) { - var text = keyNode.getText(); - var occurences = this.usedKeys[text]; - if (!occurences) { - occurences = []; - this.usedKeys[text] = occurences; - } - if (messageNode) { - if (occurences.some(function (pair) { return pair.message ? pair.message.getText() === messageNode.getText() : false; })) { - return; - } - } - occurences.push({ key: keyNode, message: messageNode }); - }; - NoUnexternalizedStringsRuleWalker.prototype.findDescribingParent = function (node) { - var parent; - while ((parent = node.parent)) { - var kind = parent.kind; - if (kind === ts.SyntaxKind.CallExpression) { - var callExpression = parent; - return { callInfo: { callExpression: callExpression, argIndex: callExpression.arguments.indexOf(node) } }; - } - else if (kind === ts.SyntaxKind.ImportEqualsDeclaration || kind === ts.SyntaxKind.ImportDeclaration || kind === ts.SyntaxKind.ExportDeclaration) { - return { ignoreUsage: true }; - } - else if (kind === ts.SyntaxKind.VariableDeclaration || kind === ts.SyntaxKind.FunctionDeclaration || kind === ts.SyntaxKind.PropertyDeclaration - || kind === ts.SyntaxKind.MethodDeclaration || kind === ts.SyntaxKind.VariableDeclarationList || kind === ts.SyntaxKind.InterfaceDeclaration - || kind === ts.SyntaxKind.ClassDeclaration || kind === ts.SyntaxKind.EnumDeclaration || kind === ts.SyntaxKind.ModuleDeclaration - || kind === ts.SyntaxKind.TypeAliasDeclaration || kind === ts.SyntaxKind.SourceFile) { - return null; - } - node = parent; - } - }; - return NoUnexternalizedStringsRuleWalker; -}(Lint.RuleWalker)); -NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE = '"'; +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ts = require("typescript"); +var Lint = require("tslint"); +/** + * Implementation of the no-unexternalized-strings rule. + */ +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + return this.applyWithWalker(new NoUnexternalizedStringsRuleWalker(sourceFile, this.getOptions())); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +function isStringLiteral(node) { + return node && node.kind === ts.SyntaxKind.StringLiteral; +} +function isObjectLiteral(node) { + return node && node.kind === ts.SyntaxKind.ObjectLiteralExpression; +} +function isPropertyAssignment(node) { + return node && node.kind === ts.SyntaxKind.PropertyAssignment; +} +var NoUnexternalizedStringsRuleWalker = (function (_super) { + __extends(NoUnexternalizedStringsRuleWalker, _super); + function NoUnexternalizedStringsRuleWalker(file, opts) { + var _this = _super.call(this, file, opts) || this; + _this.signatures = Object.create(null); + _this.ignores = Object.create(null); + _this.messageIndex = undefined; + _this.keyIndex = undefined; + _this.usedKeys = Object.create(null); + var options = _this.getOptions(); + var first = options && options.length > 0 ? options[0] : null; + if (first) { + if (Array.isArray(first.signatures)) { + first.signatures.forEach(function (signature) { return _this.signatures[signature] = true; }); + } + if (Array.isArray(first.ignores)) { + first.ignores.forEach(function (ignore) { return _this.ignores[ignore] = true; }); + } + if (typeof first.messageIndex !== 'undefined') { + _this.messageIndex = first.messageIndex; + } + if (typeof first.keyIndex !== 'undefined') { + _this.keyIndex = first.keyIndex; + } + } + return _this; + } + NoUnexternalizedStringsRuleWalker.prototype.visitSourceFile = function (node) { + var _this = this; + _super.prototype.visitSourceFile.call(this, node); + Object.keys(this.usedKeys).forEach(function (key) { + var occurences = _this.usedKeys[key]; + if (occurences.length > 1) { + occurences.forEach(function (occurence) { + _this.addFailure((_this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), "Duplicate key " + occurence.key.getText() + " with different message value."))); + }); + } + }); + }; + NoUnexternalizedStringsRuleWalker.prototype.visitStringLiteral = function (node) { + this.checkStringLiteral(node); + _super.prototype.visitStringLiteral.call(this, node); + }; + NoUnexternalizedStringsRuleWalker.prototype.checkStringLiteral = function (node) { + var text = node.getText(); + var doubleQuoted = text.length >= 2 && text[0] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE && text[text.length - 1] === NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE; + var info = this.findDescribingParent(node); + // Ignore strings in import and export nodes. + if (info && info.ignoreUsage) { + return; + } + var callInfo = info ? info.callInfo : null; + var functionName = callInfo ? callInfo.callExpression.expression.getText() : null; + if (functionName && this.ignores[functionName]) { + return; + } + if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) { + var s = node.getText(); + var replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")"); + var fix = new Lint.Fix('Unexternalitzed string', [replacement]); + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Unexternalized string found: " + node.getText(), fix)); + return; + } + // We have a single quoted string outside a localize function name. + if (!doubleQuoted && !this.signatures[functionName]) { + return; + } + // We have a string that is a direct argument into the localize call. + var keyArg = callInfo.argIndex === this.keyIndex + ? callInfo.callExpression.arguments[this.keyIndex] + : null; + if (keyArg) { + if (isStringLiteral(keyArg)) { + this.recordKey(keyArg, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined); + } + else if (isObjectLiteral(keyArg)) { + for (var i = 0; i < keyArg.properties.length; i++) { + var property = keyArg.properties[i]; + if (isPropertyAssignment(property)) { + var name_1 = property.name.getText(); + if (name_1 === 'key') { + var initializer = property.initializer; + if (isStringLiteral(initializer)) { + this.recordKey(initializer, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined); + } + break; + } + } + } + } + } + var messageArg = callInfo.argIndex === this.messageIndex + ? callInfo.callExpression.arguments[this.messageIndex] + : null; + if (messageArg && messageArg !== node) { + this.addFailure(this.createFailure(messageArg.getStart(), messageArg.getWidth(), "Message argument to '" + callInfo.callExpression.expression.getText() + "' must be a string literal.")); + return; + } + }; + NoUnexternalizedStringsRuleWalker.prototype.recordKey = function (keyNode, messageNode) { + var text = keyNode.getText(); + var occurences = this.usedKeys[text]; + if (!occurences) { + occurences = []; + this.usedKeys[text] = occurences; + } + if (messageNode) { + if (occurences.some(function (pair) { return pair.message ? pair.message.getText() === messageNode.getText() : false; })) { + return; + } + } + occurences.push({ key: keyNode, message: messageNode }); + }; + NoUnexternalizedStringsRuleWalker.prototype.findDescribingParent = function (node) { + var parent; + while ((parent = node.parent)) { + var kind = parent.kind; + if (kind === ts.SyntaxKind.CallExpression) { + var callExpression = parent; + return { callInfo: { callExpression: callExpression, argIndex: callExpression.arguments.indexOf(node) } }; + } + else if (kind === ts.SyntaxKind.ImportEqualsDeclaration || kind === ts.SyntaxKind.ImportDeclaration || kind === ts.SyntaxKind.ExportDeclaration) { + return { ignoreUsage: true }; + } + else if (kind === ts.SyntaxKind.VariableDeclaration || kind === ts.SyntaxKind.FunctionDeclaration || kind === ts.SyntaxKind.PropertyDeclaration + || kind === ts.SyntaxKind.MethodDeclaration || kind === ts.SyntaxKind.VariableDeclarationList || kind === ts.SyntaxKind.InterfaceDeclaration + || kind === ts.SyntaxKind.ClassDeclaration || kind === ts.SyntaxKind.EnumDeclaration || kind === ts.SyntaxKind.ModuleDeclaration + || kind === ts.SyntaxKind.TypeAliasDeclaration || kind === ts.SyntaxKind.SourceFile) { + return null; + } + node = parent; + } + }; + return NoUnexternalizedStringsRuleWalker; +}(Lint.RuleWalker)); +NoUnexternalizedStringsRuleWalker.DOUBLE_QUOTE = '"'; diff --git a/build/lib/typings/lib.es6.d.ts b/build/lib/typings/lib.es6.d.ts deleted file mode 100644 index 8cc95f419b1..00000000000 --- a/build/lib/typings/lib.es6.d.ts +++ /dev/null @@ -1,18296 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare var NaN: number; -declare var Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -interface ObjectConstructor { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties?: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: T): T; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: T): T; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: T): T; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare var Object: ObjectConstructor; - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(thisArg: any, ...argArray: any[]): any; - - prototype: any; - length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -interface FunctionConstructor { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - prototype: Function; -} - -declare var Function: FunctionConstructor; - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): RegExpMatchArray; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): RegExpMatchArray; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): string; - - [index: number]: string; -} - -interface StringConstructor { - new (value?: any): String; - (value?: any): string; - prototype: String; - fromCharCode(...codes: number[]): string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare var String: StringConstructor; - -interface Boolean { - /** Returns the primitive value of the specified object. */ - valueOf(): boolean; -} - -interface BooleanConstructor { - new (value?: any): Boolean; - (value?: any): boolean; - prototype: Boolean; -} - -declare var Boolean: BooleanConstructor; - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): number; -} - -interface NumberConstructor { - new (value?: any): Number; - (value?: any): number; - prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - POSITIVE_INFINITY: number; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare var Number: NumberConstructor; - -interface TemplateStringsArray extends Array { - raw: string[]; -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - E: number; - /** The natural logarithm of 10. */ - LN10: number; - /** The natural logarithm of 2. */ - LN2: number; - /** The base-2 logarithm of e. */ - LOG2E: number; - /** The base-10 logarithm of e. */ - LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - SQRT1_2: number; - /** The square root of 2. */ - SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point. - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare var Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -interface DateConstructor { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -declare var Date: DateConstructor; - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ - source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): RegExp; -} - -interface RegExpConstructor { - new (pattern: string, flags?: string): RegExp; - (pattern: string, flags?: string): RegExp; - prototype: RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -declare var RegExp: RegExpConstructor; - -interface Error { - name: string; - message: string; -} - -interface ErrorConstructor { - new (message?: string): Error; - (message?: string): Error; - prototype: Error; -} - -declare var Error: ErrorConstructor; - -interface EvalError extends Error { -} - -interface EvalErrorConstructor { - new (message?: string): EvalError; - (message?: string): EvalError; - prototype: EvalError; -} - -declare var EvalError: EvalErrorConstructor; - -interface RangeError extends Error { -} - -interface RangeErrorConstructor { - new (message?: string): RangeError; - (message?: string): RangeError; - prototype: RangeError; -} - -declare var RangeError: RangeErrorConstructor; - -interface ReferenceError extends Error { -} - -interface ReferenceErrorConstructor { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - prototype: ReferenceError; -} - -declare var ReferenceError: ReferenceErrorConstructor; - -interface SyntaxError extends Error { -} - -interface SyntaxErrorConstructor { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - prototype: SyntaxError; -} - -declare var SyntaxError: SyntaxErrorConstructor; - -interface TypeError extends Error { -} - -interface TypeErrorConstructor { - new (message?: string): TypeError; - (message?: string): TypeError; - prototype: TypeError; -} - -declare var TypeError: TypeErrorConstructor; - -interface URIError extends Error { -} - -interface URIErrorConstructor { - new (message?: string): URIError; - (message?: string): URIError; - prototype: URIError; -} - -declare var URIError: URIErrorConstructor; - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - */ - stringify(value: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - */ - stringify(value: any, replacer: (key: string, value: any) => any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - */ - stringify(value: any, replacer: any[]): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: any[], space: any): string; -} -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare var JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(): T; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} - -interface ArrayConstructor { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): boolean; - prototype: Array; -} - -declare var Array: ArrayConstructor; - -interface TypedPropertyDescriptor { - enumerable?: boolean; - configurable?: boolean; - writable?: boolean; - value?: T; - get?: () => T; - set?: (value: T) => void; -} - -declare type ClassDecorator = (target: TFunction) => TFunction | void; -declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; -declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; -declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; -declare type PropertyKey = string | number | symbol; - -interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - [Symbol.toStringTag]: string; -} - -interface SymbolConstructor { - /** - * A reference to the prototype. - */ - prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string|number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string; - - // Well-known Symbols - - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - isConcatSpreadable: symbol; - - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - iterator: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - split: symbol; - - /** - * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. - */ - toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the with - * environment bindings of the associated objects. - */ - unscopables: symbol; -} -declare var Symbol: SymbolConstructor; - -interface Object { - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects to copy properties from. - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - */ - setPrototypeOf(o: any, proto: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript - * object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor - * property. - */ - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; -} - -interface Function { - /** - * Returns a new function object that is identical to the argument object in all ways except - * for its identity and the value of its HomeObject internal slot. - */ - toMethod(newHome: Object): Function; - - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - name: string; -} - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10‍−‍16. - */ - EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface ArrayLike { - length: number; - [n: number]: T; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): T[]; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): T[]; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - contains(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form?: string): string; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; - - /** - * Returns an HTML anchor element and sets the name attribute to the text value - * @param name - */ - anchor(name: string): string; - - /** Returns a HTML element */ - big(): string; - - /** Returns a HTML element */ - blink(): string; - - /** Returns a HTML element */ - bold(): string; - - /** Returns a HTML element */ - fixed(): string - - /** Returns a HTML element and sets the color attribute value */ - fontcolor(color: string): string - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: number): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: string): string; - - /** Returns an HTML element */ - italics(): string; - - /** Returns an HTML element and sets the href attribute value */ - link(url: string): string; - - /** Returns a HTML element */ - small(): string; - - /** Returns a HTML element */ - strike(): string; - - /** Returns a HTML element */ - sub(): string; - - /** Returns a HTML element */ - sup(): string; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface GeneratorFunction extends Function { - -} - -interface GeneratorFunctionConstructor { - /** - * Creates a new Generator function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): GeneratorFunction; - (...args: string[]): GeneratorFunction; - prototype: GeneratorFunction; -} -declare var GeneratorFunction: GeneratorFunctionConstructor; - -interface Generator extends IterableIterator { - next(value?: any): IteratorResult; - throw(exception: any): IteratorResult; - return(value: T): IteratorResult; - [Symbol.iterator](): Generator; - [Symbol.toStringTag]: string; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[] ): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; - - [Symbol.toStringTag]: string; -} - -interface RegExp { - /** - * Matches a string with a regular expression, and returns an array containing the results of - * that search. - * @param string A string to search within. - */ - match(string: string): string[]; - - /** - * Replaces text in a string, using a regular expression. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every - * successful match of rgExp in stringObj. - */ - replace(string: string, replaceValue: string): string; - - search(string: string): number; - - /** - * Returns an Array object into which substrings of the result of converting string to a String - * have been stored. The substrings are determined by searching from left to right for matches - * of the this value regular expression; these occurrences are not part of any substring in the - * returned array, but serve to divide up the String value. - * - * If the regular expression that contains capturing parentheses, then each time separator is - * matched the results (including any undefined results) of the capturing parentheses are spliced. - * @param string string value to split - * @param limit if not undefined, the output array is truncated so that it contains no more - * than limit elements. - */ - split(string: string, limit?: number): string[]; - - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - flags: string; - - /** - * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular - * expression. Default is false. Read-only. - */ - sticky: boolean; - - /** - * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular - * expression. Default is false. Read-only. - */ - unicode: boolean; -} - -interface Map { - clear(): void; - delete(key: K): boolean; - entries(): IterableIterator<[K, V]>; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - keys(): IterableIterator; - set(key: K, value?: V): Map; - size: number; - values(): IterableIterator; - [Symbol.iterator]():IterableIterator<[K,V]>; - [Symbol.toStringTag]: string; -} - -interface MapConstructor { - new (): Map; - new (iterable: Iterable<[K, V]>): Map; - prototype: Map; -} -declare var Map: MapConstructor; - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; - [Symbol.toStringTag]: string; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: Iterable<[K, V]>): WeakMap; - prototype: WeakMap; -} -declare var WeakMap: WeakMapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - entries(): IterableIterator<[T, T]>; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - keys(): IterableIterator; - size: number; - values(): IterableIterator; - [Symbol.iterator]():IterableIterator; - [Symbol.toStringTag]: string; -} - -interface SetConstructor { - new (): Set; - new (iterable: Iterable): Set; - prototype: Set; -} -declare var Set: SetConstructor; - -interface WeakSet { - add(value: T): WeakSet; - clear(): void; - delete(value: T): boolean; - has(value: T): boolean; - [Symbol.toStringTag]: string; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: Iterable): WeakSet; - prototype: WeakSet; -} -declare var WeakSet: WeakSetConstructor; - -interface JSON { - [Symbol.toStringTag]: string; -} - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin: number, end?: number): ArrayBuffer; - - [Symbol.toStringTag]: string; -} - -interface ArrayBufferConstructor { - prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; - isView(arg: any): boolean; -} -declare var ArrayBuffer: ArrayBufferConstructor; - -interface DataView { - buffer: ArrayBuffer; - byteLength: number; - byteOffset: number; - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian: boolean): number; - - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian: boolean): number; - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian: boolean): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is - * no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian: boolean): number; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian: boolean): void; - - [Symbol.toStringTag]: string; -} - -interface DataViewConstructor { - new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; -} -declare var DataView: DataViewConstructor; - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Int8Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Int8Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Int8Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int8Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Int8Array; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Int8ArrayConstructor { - prototype: Int8Array; - new (length: number): Int8Array; - new (array: Int8Array): Int8Array; - new (array: number[]): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; -} -declare var Int8Array: Int8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Uint8Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Uint8Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Uint8Array; - - /** - * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Uint8ArrayConstructor { - prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: Uint8Array): Uint8Array; - new (array: number[]): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; -} -declare var Uint8Array: Uint8ArrayConstructor; - -/** - * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. - * If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8ClampedArray { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Uint8ClampedArray; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Uint8ClampedArray; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): Uint8ClampedArray; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint8ClampedArray; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8ClampedArray, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint8ClampedArray; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Uint8ClampedArray; - - /** - * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8ClampedArray; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Uint8ClampedArrayConstructor { - prototype: Uint8ClampedArray; - new (length: number): Uint8ClampedArray; - new (array: Uint8ClampedArray): Uint8ClampedArray; - new (array: number[]): Uint8ClampedArray; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint8ClampedArray; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} -declare var Uint8ClampedArray: Uint8ClampedArrayConstructor; - -/** - * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Int16Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Int16Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int16Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Int16Array; - - /** - * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Int16ArrayConstructor { - prototype: Int16Array; - new (length: number): Int16Array; - new (array: Int16Array): Int16Array; - new (array: number[]): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; -} -declare var Int16Array: Int16ArrayConstructor; - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Uint16Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Uint16Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint16Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint16Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint16Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Uint16Array; - - /** - * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Uint16ArrayConstructor { - prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: Uint16Array): Uint16Array; - new (array: number[]): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; -} -declare var Uint16Array: Uint16ArrayConstructor; - -/** - * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Int32Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Int32Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Int32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int32Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Int32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Int32Array; - - /** - * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Int32ArrayConstructor { - prototype: Int32Array; - new (length: number): Int32Array; - new (array: Int32Array): Int32Array; - new (array: number[]): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} -declare var Int32Array: Int32ArrayConstructor; - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the - * requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Uint32Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Uint32Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Uint32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint32Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Uint32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Uint32Array; - - /** - * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Uint32ArrayConstructor { - prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: Uint32Array): Uint32Array; - new (array: number[]): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} -declare var Uint32Array: Uint32ArrayConstructor; - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number - * of bytes could not be allocated an exception is raised. - */ -interface Float32Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Float32Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Float32Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float32Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float32Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float32Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Float32Array; - - /** - * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Float32ArrayConstructor { - prototype: Float32Array; - new (length: number): Float32Array; - new (array: Float32Array): Float32Array; - new (array: number[]): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; -} -declare var Float32Array: Float32ArrayConstructor; - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested - * number of bytes could not be allocated an exception is raised. - */ -interface Float64Array { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): Float64Array; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, number]>; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls - * the callbackfn function for each element in array1 until the callbackfn returns false, - * or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: number, start?: number, end?: number): Float64Array; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls - * the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array; - - /** - * Returns the value 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; - - /** - * 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, find - * immediately returns that element value. Otherwise, find returns undefined. - * @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. - */ - findIndex(predicate: (value: number) => boolean, thisArg?: any): number; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - indexOf(searchElement: number, fromIndex?: number): number; - - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the - * resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns the index of the last occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the - * search starts at index 0. - */ - lastIndexOf(searchElement: number, fromIndex?: number): number; - - /** - * The length of the array. - */ - length: number; - - /** - * Calls a defined callback function on each element of an array, and returns an array that - * contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the - * callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array. The return value of - * the callback function is the accumulated result, and is provided as an argument in the next - * call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the - * callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an - * argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. - * The return value of the callback function is the accumulated result, and is provided as an - * argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls - * the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start - * the accumulation. The first call to the callbackfn function provides this value as an argument - * instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; - - /** - * Reverses the elements in an Array. - */ - reverse(): Float64Array; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float64Array, offset?: number): void; - - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): Float64Array; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the - * callbackfn function for each element in array1 until the callbackfn returns true, or until - * the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. - * If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: number, b: number) => number): Float64Array; - - /** - * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements - * at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; - - /** - * Converts a number to a string by using the current locale. - */ - toLocaleString(): string; - - /** - * Returns a string representation of an array. - */ - toString(): string; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; - - [index: number]: number; - [Symbol.iterator](): IterableIterator; -} - -interface Float64ArrayConstructor { - prototype: Float64Array; - new (length: number): Float64Array; - new (array: Float64Array): Float64Array; - new (array: number[]): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: number[]): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} -declare var Float64Array: Float64ArrayConstructor; - -interface ProxyHandler { - getPrototypeOf? (target: T): any; - setPrototypeOf? (target: T, v: any): boolean; - isExtensible? (target: T): boolean; - preventExtensions? (target: T): boolean; - getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; - has? (target: T, p: PropertyKey): boolean; - get? (target: T, p: PropertyKey, receiver: any): any; - set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; - deleteProperty? (target: T, p: PropertyKey): boolean; - defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; - enumerate? (target: T): PropertyKey[]; - ownKeys? (target: T): PropertyKey[]; - apply? (target: T, thisArg: any, argArray?: any): any; - construct? (target: T, thisArg: any, argArray?: any): any; -} - -interface ProxyConstructor { - revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; - new (target: T, handler: ProxyHandler): T -} -declare var Proxy: ProxyConstructor; - -declare module Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): IterableIterator; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: string): boolean; - function has(target: any, propertyKey: symbol): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -} - -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; -} - -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * 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): Promise; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: (reason: any) => T | PromiseLike): Promise; - - [Symbol.toStringTag]: string; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; - - [Symbol.species]: Function; -} - -declare var Promise: PromiseConstructor; - -interface ArrayBufferView { - /** - * The ArrayBuffer instance referenced by the array. - */ - buffer: ArrayBuffer; - - /** - * The length in bytes of the array. - */ - byteLength: number; - - /** - * The offset in bytes of the array. - */ - byteOffset: number; -}///////////////////////////// -/// ECMAScript Internationalization API -///////////////////////////// - -declare module Intl { - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string[], options?: CollatorOptions): Collator; - new (locale?: string, options?: CollatorOptions): Collator; - (locales?: string[], options?: CollatorOptions): Collator; - (locale?: string, options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; - supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumintegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string[], options?: NumberFormatOptions): Collator; - new (locale?: string, options?: NumberFormatOptions): Collator; - (locales?: string[], options?: NumberFormatOptions): Collator; - (locale?: string, options?: NumberFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12?: boolean; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date: number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string[], options?: DateTimeFormatOptions): Collator; - new (locale?: string, options?: DateTimeFormatOptions): Collator; - (locales?: string[], options?: DateTimeFormatOptions): Collator; - (locale?: string, options?: DateTimeFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; - - /** - * Converts a number to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; -} - - -///////////////////////////// -/// IE DOM APIs -///////////////////////////// - -interface Algorithm { - name?: string; -} - -interface AriaRequestEventInit extends EventInit { - attributeName?: string; - attributeValue?: string; -} - -interface ClipboardEventInit extends EventInit { - data?: string; - dataType?: string; -} - -interface CommandEventInit extends EventInit { - commandName?: string; - detail?: string; -} - -interface CompositionEventInit extends UIEventInit { - data?: string; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: string[]; -} - -interface CustomEventInit extends EventInit { - detail?: any; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; -} - -interface ExceptionInformation { - domain?: string; -} - -interface FocusEventInit extends UIEventInit { - relatedTarget?: EventTarget; -} - -interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; -} - -interface KeyAlgorithm { - name?: string; -} - -interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit { - key?: string; - location?: number; - repeat?: boolean; -} - -interface MouseEventInit extends SharedKeyboardAndMouseEventInit { - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: string[]; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface PointerEventInit extends MouseEventInit { - pointerId?: number; - width?: number; - height?: number; - pressure?: number; - tiltX?: number; - tiltY?: number; - pointerType?: string; - isPrimary?: boolean; -} - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface SharedKeyboardAndMouseEventInit extends UIEventInit { - ctrlKey?: boolean; - shiftKey?: boolean; - altKey?: boolean; - metaKey?: boolean; - keyModifierStateAltGraph?: boolean; - keyModifierStateCapsLock?: boolean; - keyModifierStateFn?: boolean; - keyModifierStateFnLock?: boolean; - keyModifierStateHyper?: boolean; - keyModifierStateNumLock?: boolean; - keyModifierStateOS?: boolean; - keyModifierStateScrollLock?: boolean; - keyModifierStateSuper?: boolean; - keyModifierStateSymbol?: boolean; - keyModifierStateSymbolLock?: boolean; -} - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; -} - -interface UIEventInit extends EventInit { - view?: Window; - detail?: number; -} - -interface WebGLContextAttributes { - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; -} - -interface WebGLContextEventInit extends EventInit { - statusMessage?: string; -} - -interface WheelEventInit extends MouseEventInit { - deltaX?: number; - deltaY?: number; - deltaZ?: number; - deltaMode?: number; -} - -interface EventListener { - (evt: Event): void; -} - -interface ANGLE_instanced_arrays { - drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; - drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; - vertexAttribDivisorANGLE(index: number, divisor: number): void; - VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -declare var ANGLE_instanced_arrays: { - prototype: ANGLE_instanced_arrays; - new(): ANGLE_instanced_arrays; - VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; -} - -interface AnalyserNode extends AudioNode { - fftSize: number; - frequencyBinCount: number; - maxDecibels: number; - minDecibels: number; - smoothingTimeConstant: number; - getByteFrequencyData(array: Uint8Array): void; - getByteTimeDomainData(array: Uint8Array): void; - getFloatFrequencyData(array: any): void; - getFloatTimeDomainData(array: any): void; -} - -declare var AnalyserNode: { - prototype: AnalyserNode; - new(): AnalyserNode; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} - -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface ApplicationCache extends EventTarget { - oncached: (ev: Event) => any; - onchecking: (ev: Event) => any; - ondownloading: (ev: Event) => any; - onerror: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - status: number; - abort(): void; - swapCache(): void; - update(): void; - CHECKING: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - UNCACHED: number; - UPDATEREADY: number; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - UNCACHED: number; - UPDATEREADY: number; -} - -interface AriaRequestEvent extends Event { - attributeName: string; - attributeValue: string; -} - -declare var AriaRequestEvent: { - prototype: AriaRequestEvent; - new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; -} - -interface Attr extends Node { - name: string; - ownerElement: Element; - specified: boolean; - value: string; -} - -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface AudioBuffer { - duration: number; - length: number; - numberOfChannels: number; - sampleRate: number; - getChannelData(channel: number): any; -} - -declare var AudioBuffer: { - prototype: AudioBuffer; - new(): AudioBuffer; -} - -interface AudioBufferSourceNode extends AudioNode { - buffer: AudioBuffer; - loop: boolean; - loopEnd: number; - loopStart: number; - onended: (ev: Event) => any; - playbackRate: AudioParam; - start(when?: number, offset?: number, duration?: number): void; - stop(when?: number): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var AudioBufferSourceNode: { - prototype: AudioBufferSourceNode; - new(): AudioBufferSourceNode; -} - -interface AudioContext extends EventTarget { - currentTime: number; - destination: AudioDestinationNode; - listener: AudioListener; - sampleRate: number; - createAnalyser(): AnalyserNode; - createBiquadFilter(): BiquadFilterNode; - createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; - createBufferSource(): AudioBufferSourceNode; - createChannelMerger(numberOfInputs?: number): ChannelMergerNode; - createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; - createConvolver(): ConvolverNode; - createDelay(maxDelayTime?: number): DelayNode; - createDynamicsCompressor(): DynamicsCompressorNode; - createGain(): GainNode; - createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; - createOscillator(): OscillatorNode; - createPanner(): PannerNode; - createPeriodicWave(real: any, imag: any): PeriodicWave; - createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; - createStereoPanner(): StereoPannerNode; - createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void; -} - -declare var AudioContext: { - prototype: AudioContext; - new(): AudioContext; -} - -interface AudioDestinationNode extends AudioNode { - maxChannelCount: number; -} - -declare var AudioDestinationNode: { - prototype: AudioDestinationNode; - new(): AudioDestinationNode; -} - -interface AudioListener { - dopplerFactor: number; - speedOfSound: number; - setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var AudioListener: { - prototype: AudioListener; - new(): AudioListener; -} - -interface AudioNode extends EventTarget { - channelCount: number; - channelCountMode: string; - channelInterpretation: string; - context: AudioContext; - numberOfInputs: number; - numberOfOutputs: number; - connect(destination: AudioNode, output?: number, input?: number): void; - disconnect(output?: number): void; -} - -declare var AudioNode: { - prototype: AudioNode; - new(): AudioNode; -} - -interface AudioParam { - defaultValue: number; - value: number; - cancelScheduledValues(startTime: number): void; - exponentialRampToValueAtTime(value: number, endTime: number): void; - linearRampToValueAtTime(value: number, endTime: number): void; - setTargetAtTime(target: number, startTime: number, timeConstant: number): void; - setValueAtTime(value: number, startTime: number): void; - setValueCurveAtTime(values: any, startTime: number, duration: number): void; -} - -declare var AudioParam: { - prototype: AudioParam; - new(): AudioParam; -} - -interface AudioProcessingEvent extends Event { - inputBuffer: AudioBuffer; - outputBuffer: AudioBuffer; - playbackTime: number; -} - -declare var AudioProcessingEvent: { - prototype: AudioProcessingEvent; - new(): AudioProcessingEvent; -} - -interface AudioTrack { - enabled: boolean; - id: string; - kind: string; - label: string; - language: string; - sourceBuffer: SourceBuffer; -} - -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface AudioTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - onchange: (ev: Event) => any; - onremovetrack: (ev: TrackEvent) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: AudioTrack; -} - -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface BarProp { - visible: boolean; -} - -declare var BarProp: { - prototype: BarProp; - new(): BarProp; -} - -interface BeforeUnloadEvent extends Event { - returnValue: any; -} - -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface BiquadFilterNode extends AudioNode { - Q: AudioParam; - detune: AudioParam; - frequency: AudioParam; - gain: AudioParam; - type: string; - getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void; -} - -declare var BiquadFilterNode: { - prototype: BiquadFilterNode; - new(): BiquadFilterNode; -} - -interface Blob { - size: number; - type: string; - msClose(): void; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; -} - -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface CDATASection extends Text { -} - -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface CSS { - supports(property: string, value?: string): boolean; -} -declare var CSS: CSS; - -interface CSSConditionRule extends CSSGroupingRule { - conditionText: string; -} - -declare var CSSConditionRule: { - prototype: CSSConditionRule; - new(): CSSConditionRule; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} - -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface CSSGroupingRule extends CSSRule { - cssRules: CSSRuleList; - deleteRule(index?: number): void; - insertRule(rule: string, index?: number): number; -} - -declare var CSSGroupingRule: { - prototype: CSSGroupingRule; - new(): CSSGroupingRule; -} - -interface CSSImportRule extends CSSRule { - href: string; - media: MediaList; - styleSheet: CSSStyleSheet; -} - -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} - -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface CSSKeyframesRule extends CSSRule { - cssRules: CSSRuleList; - name: string; - appendRule(rule: string): void; - deleteRule(rule: string): void; - findRule(rule: string): CSSKeyframeRule; -} - -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface CSSMediaRule extends CSSConditionRule { - media: MediaList; -} - -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} - -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selector: string; - selectorText: string; - style: CSSStyleDeclaration; -} - -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface CSSRule { - cssText: string; - parentRule: CSSRule; - parentStyleSheet: CSSStyleSheet; - type: number; - CHARSET_RULE: number; - FONT_FACE_RULE: number; - IMPORT_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - MEDIA_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - STYLE_RULE: number; - SUPPORTS_RULE: number; - UNKNOWN_RULE: number; - VIEWPORT_RULE: number; -} - -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - CHARSET_RULE: number; - FONT_FACE_RULE: number; - IMPORT_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - MEDIA_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - STYLE_RULE: number; - SUPPORTS_RULE: number; - UNKNOWN_RULE: number; - VIEWPORT_RULE: number; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} - -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface CSSStyleDeclaration { - alignContent: string; - alignItems: string; - alignSelf: string; - alignmentBaseline: string; - animation: string; - animationDelay: string; - animationDirection: string; - animationDuration: string; - animationFillMode: string; - animationIterationCount: string; - animationName: string; - animationPlayState: string; - animationTimingFunction: string; - backfaceVisibility: string; - background: string; - backgroundAttachment: string; - backgroundClip: string; - backgroundColor: string; - backgroundImage: string; - backgroundOrigin: string; - backgroundPosition: string; - backgroundPositionX: string; - backgroundPositionY: string; - backgroundRepeat: string; - backgroundSize: string; - baselineShift: string; - border: string; - borderBottom: string; - borderBottomColor: string; - borderBottomLeftRadius: string; - borderBottomRightRadius: string; - borderBottomStyle: string; - borderBottomWidth: string; - borderCollapse: string; - borderColor: string; - borderImage: string; - borderImageOutset: string; - borderImageRepeat: string; - borderImageSlice: string; - borderImageSource: string; - borderImageWidth: string; - borderLeft: string; - borderLeftColor: string; - borderLeftStyle: string; - borderLeftWidth: string; - borderRadius: string; - borderRight: string; - borderRightColor: string; - borderRightStyle: string; - borderRightWidth: string; - borderSpacing: string; - borderStyle: string; - borderTop: string; - borderTopColor: string; - borderTopLeftRadius: string; - borderTopRightRadius: string; - borderTopStyle: string; - borderTopWidth: string; - borderWidth: string; - bottom: string; - boxShadow: string; - boxSizing: string; - breakAfter: string; - breakBefore: string; - breakInside: string; - captionSide: string; - clear: string; - clip: string; - clipPath: string; - clipRule: string; - color: string; - colorInterpolationFilters: string; - columnCount: any; - columnFill: string; - columnGap: any; - columnRule: string; - columnRuleColor: any; - columnRuleStyle: string; - columnRuleWidth: any; - columnSpan: string; - columnWidth: any; - columns: string; - content: string; - counterIncrement: string; - counterReset: string; - cssFloat: string; - cssText: string; - cursor: string; - direction: string; - display: string; - dominantBaseline: string; - emptyCells: string; - enableBackground: string; - fill: string; - fillOpacity: string; - fillRule: string; - filter: string; - flex: string; - flexBasis: string; - flexDirection: string; - flexFlow: string; - flexGrow: string; - flexShrink: string; - flexWrap: string; - floodColor: string; - floodOpacity: string; - font: string; - fontFamily: string; - fontFeatureSettings: string; - fontSize: string; - fontSizeAdjust: string; - fontStretch: string; - fontStyle: string; - fontVariant: string; - fontWeight: string; - glyphOrientationHorizontal: string; - glyphOrientationVertical: string; - height: string; - imeMode: string; - justifyContent: string; - kerning: string; - left: string; - length: number; - letterSpacing: string; - lightingColor: string; - lineHeight: string; - listStyle: string; - listStyleImage: string; - listStylePosition: string; - listStyleType: string; - margin: string; - marginBottom: string; - marginLeft: string; - marginRight: string; - marginTop: string; - marker: string; - markerEnd: string; - markerMid: string; - markerStart: string; - mask: string; - maxHeight: string; - maxWidth: string; - minHeight: string; - minWidth: string; - msContentZoomChaining: string; - msContentZoomLimit: string; - msContentZoomLimitMax: any; - msContentZoomLimitMin: any; - msContentZoomSnap: string; - msContentZoomSnapPoints: string; - msContentZoomSnapType: string; - msContentZooming: string; - msFlowFrom: string; - msFlowInto: string; - msFontFeatureSettings: string; - msGridColumn: any; - msGridColumnAlign: string; - msGridColumnSpan: any; - msGridColumns: string; - msGridRow: any; - msGridRowAlign: string; - msGridRowSpan: any; - msGridRows: string; - msHighContrastAdjust: string; - msHyphenateLimitChars: string; - msHyphenateLimitLines: any; - msHyphenateLimitZone: any; - msHyphens: string; - msImeAlign: string; - msOverflowStyle: string; - msScrollChaining: string; - msScrollLimit: string; - msScrollLimitXMax: any; - msScrollLimitXMin: any; - msScrollLimitYMax: any; - msScrollLimitYMin: any; - msScrollRails: string; - msScrollSnapPointsX: string; - msScrollSnapPointsY: string; - msScrollSnapType: string; - msScrollSnapX: string; - msScrollSnapY: string; - msScrollTranslation: string; - msTextCombineHorizontal: string; - msTextSizeAdjust: any; - msTouchAction: string; - msTouchSelect: string; - msUserSelect: string; - msWrapFlow: string; - msWrapMargin: any; - msWrapThrough: string; - opacity: string; - order: string; - orphans: string; - outline: string; - outlineColor: string; - outlineStyle: string; - outlineWidth: string; - overflow: string; - overflowX: string; - overflowY: string; - padding: string; - paddingBottom: string; - paddingLeft: string; - paddingRight: string; - paddingTop: string; - pageBreakAfter: string; - pageBreakBefore: string; - pageBreakInside: string; - parentRule: CSSRule; - perspective: string; - perspectiveOrigin: string; - pointerEvents: string; - position: string; - quotes: string; - right: string; - rubyAlign: string; - rubyOverhang: string; - rubyPosition: string; - stopColor: string; - stopOpacity: string; - stroke: string; - strokeDasharray: string; - strokeDashoffset: string; - strokeLinecap: string; - strokeLinejoin: string; - strokeMiterlimit: string; - strokeOpacity: string; - strokeWidth: string; - tableLayout: string; - textAlign: string; - textAlignLast: string; - textAnchor: string; - textDecoration: string; - textFillColor: string; - textIndent: string; - textJustify: string; - textKashida: string; - textKashidaSpace: string; - textOverflow: string; - textShadow: string; - textTransform: string; - textUnderlinePosition: string; - top: string; - touchAction: string; - transform: string; - transformOrigin: string; - transformStyle: string; - transition: string; - transitionDelay: string; - transitionDuration: string; - transitionProperty: string; - transitionTimingFunction: string; - unicodeBidi: string; - verticalAlign: string; - visibility: string; - webkitAlignContent: string; - webkitAlignItems: string; - webkitAlignSelf: string; - webkitAnimation: string; - webkitAnimationDelay: string; - webkitAnimationDirection: string; - webkitAnimationDuration: string; - webkitAnimationFillMode: string; - webkitAnimationIterationCount: string; - webkitAnimationName: string; - webkitAnimationPlayState: string; - webkitAnimationTimingFunction: string; - webkitAppearance: string; - webkitBackfaceVisibility: string; - webkitBackground: string; - webkitBackgroundAttachment: string; - webkitBackgroundClip: string; - webkitBackgroundColor: string; - webkitBackgroundImage: string; - webkitBackgroundOrigin: string; - webkitBackgroundPosition: string; - webkitBackgroundPositionX: string; - webkitBackgroundPositionY: string; - webkitBackgroundRepeat: string; - webkitBackgroundSize: string; - webkitBorderBottomLeftRadius: string; - webkitBorderBottomRightRadius: string; - webkitBorderImage: string; - webkitBorderImageOutset: string; - webkitBorderImageRepeat: string; - webkitBorderImageSlice: string; - webkitBorderImageSource: string; - webkitBorderImageWidth: string; - webkitBorderRadius: string; - webkitBorderTopLeftRadius: string; - webkitBorderTopRightRadius: string; - webkitBoxAlign: string; - webkitBoxDirection: string; - webkitBoxFlex: string; - webkitBoxOrdinalGroup: string; - webkitBoxOrient: string; - webkitBoxPack: string; - webkitBoxSizing: string; - webkitColumnBreakAfter: string; - webkitColumnBreakBefore: string; - webkitColumnBreakInside: string; - webkitColumnCount: any; - webkitColumnGap: any; - webkitColumnRule: string; - webkitColumnRuleColor: any; - webkitColumnRuleStyle: string; - webkitColumnRuleWidth: any; - webkitColumnSpan: string; - webkitColumnWidth: any; - webkitColumns: string; - webkitFilter: string; - webkitFlex: string; - webkitFlexBasis: string; - webkitFlexDirection: string; - webkitFlexFlow: string; - webkitFlexGrow: string; - webkitFlexShrink: string; - webkitFlexWrap: string; - webkitJustifyContent: string; - webkitOrder: string; - webkitPerspective: string; - webkitPerspectiveOrigin: string; - webkitTapHighlightColor: string; - webkitTextFillColor: string; - webkitTextSizeAdjust: any; - webkitTransform: string; - webkitTransformOrigin: string; - webkitTransformStyle: string; - webkitTransition: string; - webkitTransitionDelay: string; - webkitTransitionDuration: string; - webkitTransitionProperty: string; - webkitTransitionTimingFunction: string; - webkitUserSelect: string; - webkitWritingMode: string; - whiteSpace: string; - widows: string; - width: string; - wordBreak: string; - wordSpacing: string; - wordWrap: string; - writingMode: string; - zIndex: string; - zoom: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - item(index: number): string; - removeProperty(propertyName: string): string; - setProperty(propertyName: string, value: string, priority?: string): void; - [index: number]: string; -} - -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface CSSStyleRule extends CSSRule { - readOnly: boolean; - selectorText: string; - style: CSSStyleDeclaration; -} - -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface CSSStyleSheet extends StyleSheet { - cssRules: CSSRuleList; - cssText: string; - href: string; - id: string; - imports: StyleSheetList; - isAlternate: boolean; - isPrefAlternate: boolean; - ownerRule: CSSRule; - owningElement: Element; - pages: StyleSheetPageList; - readOnly: boolean; - rules: CSSRuleList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - deleteRule(index?: number): void; - insertRule(rule: string, index?: number): number; - removeImport(lIndex: number): void; - removeRule(lIndex: number): void; -} - -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface CSSSupportsRule extends CSSConditionRule { -} - -declare var CSSSupportsRule: { - prototype: CSSSupportsRule; - new(): CSSSupportsRule; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} - -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface CanvasPattern { -} - -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface CanvasRenderingContext2D { - canvas: HTMLCanvasElement; - fillStyle: any; - font: string; - globalAlpha: number; - globalCompositeOperation: string; - lineCap: string; - lineDashOffset: number; - lineJoin: string; - lineWidth: number; - miterLimit: number; - msFillRule: string; - msImageSmoothingEnabled: boolean; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; - strokeStyle: any; - textAlign: string; - textBaseline: string; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - beginPath(): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - clearRect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - closePath(): void; - createImageData(imageDataOrSw: number, sh?: number): ImageData; - createImageData(imageDataOrSw: ImageData, sh?: number): ImageData; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: HTMLImageElement, repetition: string): CanvasPattern; - createPattern(image: HTMLCanvasElement, repetition: string): CanvasPattern; - createPattern(image: HTMLVideoElement, repetition: string): CanvasPattern; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - drawImage(image: HTMLImageElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - drawImage(image: HTMLCanvasElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - drawImage(image: HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - fill(fillRule?: string): void; - fillRect(x: number, y: number, w: number, h: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - getLineDash(): number[]; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - lineTo(x: number, y: number): void; - measureText(text: string): TextMetrics; - moveTo(x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - rect(x: number, y: number, w: number, h: number): void; - restore(): void; - rotate(angle: number): void; - save(): void; - scale(x: number, y: number): void; - setLineDash(segments: number[]): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - translate(x: number, y: number): void; -} - -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface ChannelMergerNode extends AudioNode { -} - -declare var ChannelMergerNode: { - prototype: ChannelMergerNode; - new(): ChannelMergerNode; -} - -interface ChannelSplitterNode extends AudioNode { -} - -declare var ChannelSplitterNode: { - prototype: ChannelSplitterNode; - new(): ChannelSplitterNode; -} - -interface CharacterData extends Node, ChildNode { - data: string; - length: number; - appendData(arg: string): void; - deleteData(offset: number, count: number): void; - insertData(offset: number, arg: string): void; - replaceData(offset: number, count: number, arg: string): void; - substringData(offset: number, count: number): string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface ClientRect { - bottom: number; - height: number; - left: number; - right: number; - top: number; - width: number; -} - -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} - -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface ClipboardEvent extends Event { - clipboardData: DataTransfer; -} - -declare var ClipboardEvent: { - prototype: ClipboardEvent; - new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; -} - -interface CloseEvent extends Event { - code: number; - reason: string; - wasClean: boolean; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} - -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface CommandEvent extends Event { - commandName: string; - detail: string; -} - -declare var CommandEvent: { - prototype: CommandEvent; - new(type: string, eventInitDict?: CommandEventInit): CommandEvent; -} - -interface Comment extends CharacterData { - text: string; -} - -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} - -declare var CompositionEvent: { - prototype: CompositionEvent; - new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; -} - -interface Console { - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - clear(): void; - count(countTitle?: string): void; - debug(message?: string, ...optionalParams: any[]): void; - dir(value?: any, ...optionalParams: any[]): void; - dirxml(value: any): void; - error(message?: any, ...optionalParams: any[]): void; - group(groupTitle?: string): void; - groupCollapsed(groupTitle?: string): void; - groupEnd(): void; - info(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - profile(reportName?: string): void; - profileEnd(): void; - select(element: Element): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - warn(message?: any, ...optionalParams: any[]): void; -} - -declare var Console: { - prototype: Console; - new(): Console; -} - -interface ConvolverNode extends AudioNode { - buffer: AudioBuffer; - normalize: boolean; -} - -declare var ConvolverNode: { - prototype: ConvolverNode; - new(): ConvolverNode; -} - -interface Coordinates { - accuracy: number; - altitude: number; - altitudeAccuracy: number; - heading: number; - latitude: number; - longitude: number; - speed: number; -} - -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface Crypto extends Object, RandomSource { - subtle: SubtleCrypto; -} - -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -} - -interface CryptoKey { - algorithm: KeyAlgorithm; - extractable: boolean; - type: string; - usages: string[]; -} - -declare var CryptoKey: { - prototype: CryptoKey; - new(): CryptoKey; -} - -interface CryptoKeyPair { - privateKey: CryptoKey; - publicKey: CryptoKey; -} - -declare var CryptoKeyPair: { - prototype: CryptoKeyPair; - new(): CryptoKeyPair; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} - -declare var CustomEvent: { - prototype: CustomEvent; - new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; -} - -interface DOMError { - name: string; - toString(): string; -} - -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface DOMException { - code: number; - message: string; - name: string; - toString(): string; - ABORT_ERR: number; - DATA_CLONE_ERR: number; - DOMSTRING_SIZE_ERR: number; - HIERARCHY_REQUEST_ERR: number; - INDEX_SIZE_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_ACCESS_ERR: number; - INVALID_CHARACTER_ERR: number; - INVALID_MODIFICATION_ERR: number; - INVALID_NODE_TYPE_ERR: number; - INVALID_STATE_ERR: number; - NAMESPACE_ERR: number; - NETWORK_ERR: number; - NOT_FOUND_ERR: number; - NOT_SUPPORTED_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - PARSE_ERR: number; - QUOTA_EXCEEDED_ERR: number; - SECURITY_ERR: number; - SERIALIZE_ERR: number; - SYNTAX_ERR: number; - TIMEOUT_ERR: number; - TYPE_MISMATCH_ERR: number; - URL_MISMATCH_ERR: number; - VALIDATION_ERR: number; - WRONG_DOCUMENT_ERR: number; -} - -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - ABORT_ERR: number; - DATA_CLONE_ERR: number; - DOMSTRING_SIZE_ERR: number; - HIERARCHY_REQUEST_ERR: number; - INDEX_SIZE_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_ACCESS_ERR: number; - INVALID_CHARACTER_ERR: number; - INVALID_MODIFICATION_ERR: number; - INVALID_NODE_TYPE_ERR: number; - INVALID_STATE_ERR: number; - NAMESPACE_ERR: number; - NETWORK_ERR: number; - NOT_FOUND_ERR: number; - NOT_SUPPORTED_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - PARSE_ERR: number; - QUOTA_EXCEEDED_ERR: number; - SECURITY_ERR: number; - SERIALIZE_ERR: number; - SYNTAX_ERR: number; - TIMEOUT_ERR: number; - TYPE_MISMATCH_ERR: number; - URL_MISMATCH_ERR: number; - VALIDATION_ERR: number; - WRONG_DOCUMENT_ERR: number; -} - -interface DOMImplementation { - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createHTMLDocument(title: string): Document; - hasFeature(feature: string, version: string): boolean; -} - -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} - -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} - -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} - -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface DOMStringMap { - [name: string]: string; -} - -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -} - -interface DOMTokenList { - length: number; - add(...token: string[]): void; - contains(token: string): boolean; - item(index: number): string; - remove(...token: string[]): void; - toString(): string; - toggle(token: string, force?: boolean): boolean; - [index: number]: string; -} - -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface DataCue extends TextTrackCue { - data: ArrayBuffer; -} - -declare var DataCue: { - prototype: DataCue; - new(): DataCue; -} - -interface DataTransfer { - dropEffect: string; - effectAllowed: string; - files: FileList; - items: DataTransferItemList; - types: DOMStringList; - clearData(format?: string): boolean; - getData(format: string): string; - setData(format: string, data: string): boolean; -} - -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface DataTransferItem { - kind: string; - type: string; - getAsFile(): File; - getAsString(_callback: FunctionStringCallback): void; -} - -declare var DataTransferItem: { - prototype: DataTransferItem; - new(): DataTransferItem; -} - -interface DataTransferItemList { - length: number; - add(data: File): DataTransferItem; - clear(): void; - item(index: number): File; - remove(index: number): void; - [index: number]: File; -} - -declare var DataTransferItemList: { - prototype: DataTransferItemList; - new(): DataTransferItemList; -} - -interface DeferredPermissionRequest { - id: number; - type: string; - uri: string; - allow(): void; - deny(): void; -} - -declare var DeferredPermissionRequest: { - prototype: DeferredPermissionRequest; - new(): DeferredPermissionRequest; -} - -interface DelayNode extends AudioNode { - delayTime: AudioParam; -} - -declare var DelayNode: { - prototype: DelayNode; - new(): DelayNode; -} - -interface DeviceAcceleration { - x: number; - y: number; - z: number; -} - -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; -} - -interface DeviceMotionEvent extends Event { - acceleration: DeviceAcceleration; - accelerationIncludingGravity: DeviceAcceleration; - interval: number; - rotationRate: DeviceRotationRate; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} - -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; -} - -interface DeviceOrientationEvent extends Event { - absolute: boolean; - alpha: number; - beta: number; - gamma: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} - -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; -} - -interface DeviceRotationRate { - alpha: number; - beta: number; - gamma: number; -} - -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent { - /** - * Sets or gets the URL for the current document. - */ - URL: string; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - /** - * Returns a reference to the collection of elements contained by the object. - */ - all: HTMLCollection; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - characterSet: string; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - cookie: string; - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - defaultView: Window; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * 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. - */ - doctype: DocumentType; - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollection; - fullscreenElement: Element; - fullscreenEnabled: boolean; - head: HTMLHeadElement; - hidden: boolean; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollection; - /** - * Contains information about the current URL. - */ - location: Location; - media: string; - msCSSOMElementFloatMetrics: boolean; - msCapsLockWarningOff: boolean; - msHidden: boolean; - msVisibilityState: string; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: Event) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (ev: UIEvent) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - /** - * 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. - * @param ev The event. - */ - oncanplay: (ev: Event) => any; - oncanplaythrough: (ev: Event) => any; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (ev: Event) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - /** - * 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; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @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. - */ - ondragleave: (ev: DragEvent) => any; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - /** - * 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. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; - /** - * 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. - * @param ev The event - */ - onended: (ev: Event) => any; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: Event) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - onfullscreenchange: (ev: Event) => any; - onfullscreenerror: (ev: Event) => any; - oninput: (ev: Event) => any; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (ev: KeyboardEvent) => any; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (ev: KeyboardEvent) => any; - /** - * 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. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - /** - * 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. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - /** - * 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. - * @param ev The mouse event. - */ - onmouseout: (ev: MouseEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - /** - * 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. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - onmscontentzoom: (ev: UIEvent) => any; - onmsgesturechange: (ev: MSGestureEvent) => any; - onmsgesturedoubletap: (ev: MSGestureEvent) => any; - onmsgestureend: (ev: MSGestureEvent) => any; - onmsgesturehold: (ev: MSGestureEvent) => any; - onmsgesturestart: (ev: MSGestureEvent) => any; - onmsgesturetap: (ev: MSGestureEvent) => any; - onmsinertiastart: (ev: MSGestureEvent) => any; - onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; - onmspointercancel: (ev: MSPointerEvent) => any; - onmspointerdown: (ev: MSPointerEvent) => any; - onmspointerenter: (ev: MSPointerEvent) => any; - onmspointerleave: (ev: MSPointerEvent) => any; - onmspointermove: (ev: MSPointerEvent) => any; - onmspointerout: (ev: MSPointerEvent) => any; - 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. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - /** - * 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. - * @param ev The event. - */ - onprogress: (ev: ProgressEvent) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: ProgressEvent) => any; - /** - * 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. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - onsubmit: (ev: Event) => any; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (ev: Event) => any; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - onwebkitfullscreenchange: (ev: Event) => any; - onwebkitfullscreenerror: (ev: Event) => any; - plugins: HTMLCollection; - pointerLockElement: Element; - /** - * Retrieves a value that indicates the current state of the object. - */ - readyState: string; - /** - * Gets the URL of the location that referred the user to the current page. - */ - referrer: string; - /** - * Gets the root svg element in the document hierarchy. - */ - rootElement: SVGSVGElement; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - security: string; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - /** - * Contains the title of the document. - */ - title: string; - visibilityState: string; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - webkitCurrentFullScreenElement: Element; - webkitFullscreenElement: Element; - webkitFullscreenEnabled: boolean; - webkitIsFullScreen: boolean; - xmlEncoding: string; - xmlStandalone: boolean; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string; - adoptNode(source: Node): Node; - captureEvents(): void; - clear(): void; - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; - createCDATASection(data: string): CDATASection; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "a"): HTMLAnchorElement; - createElement(tagName: "abbr"): HTMLPhraseElement; - createElement(tagName: "acronym"): HTMLPhraseElement; - createElement(tagName: "address"): HTMLBlockElement; - createElement(tagName: "applet"): HTMLAppletElement; - createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "audio"): HTMLAudioElement; - createElement(tagName: "b"): HTMLPhraseElement; - createElement(tagName: "base"): HTMLBaseElement; - createElement(tagName: "basefont"): HTMLBaseFontElement; - createElement(tagName: "bdo"): HTMLPhraseElement; - createElement(tagName: "big"): HTMLPhraseElement; - createElement(tagName: "blockquote"): HTMLBlockElement; - createElement(tagName: "body"): HTMLBodyElement; - createElement(tagName: "br"): HTMLBRElement; - createElement(tagName: "button"): HTMLButtonElement; - createElement(tagName: "canvas"): HTMLCanvasElement; - createElement(tagName: "caption"): HTMLTableCaptionElement; - createElement(tagName: "center"): HTMLBlockElement; - createElement(tagName: "cite"): HTMLPhraseElement; - createElement(tagName: "code"): HTMLPhraseElement; - createElement(tagName: "col"): HTMLTableColElement; - createElement(tagName: "colgroup"): HTMLTableColElement; - createElement(tagName: "datalist"): HTMLDataListElement; - createElement(tagName: "dd"): HTMLDDElement; - createElement(tagName: "del"): HTMLModElement; - createElement(tagName: "dfn"): HTMLPhraseElement; - createElement(tagName: "dir"): HTMLDirectoryElement; - createElement(tagName: "div"): HTMLDivElement; - createElement(tagName: "dl"): HTMLDListElement; - createElement(tagName: "dt"): HTMLDTElement; - createElement(tagName: "em"): HTMLPhraseElement; - createElement(tagName: "embed"): HTMLEmbedElement; - createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "form"): HTMLFormElement; - createElement(tagName: "frame"): HTMLFrameElement; - createElement(tagName: "frameset"): HTMLFrameSetElement; - createElement(tagName: "h1"): HTMLHeadingElement; - createElement(tagName: "h2"): HTMLHeadingElement; - createElement(tagName: "h3"): HTMLHeadingElement; - createElement(tagName: "h4"): HTMLHeadingElement; - createElement(tagName: "h5"): HTMLHeadingElement; - createElement(tagName: "h6"): HTMLHeadingElement; - createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "hr"): HTMLHRElement; - createElement(tagName: "html"): HTMLHtmlElement; - createElement(tagName: "i"): HTMLPhraseElement; - createElement(tagName: "iframe"): HTMLIFrameElement; - createElement(tagName: "img"): HTMLImageElement; - createElement(tagName: "input"): HTMLInputElement; - createElement(tagName: "ins"): HTMLModElement; - createElement(tagName: "isindex"): HTMLIsIndexElement; - createElement(tagName: "kbd"): HTMLPhraseElement; - createElement(tagName: "keygen"): HTMLBlockElement; - createElement(tagName: "label"): HTMLLabelElement; - createElement(tagName: "legend"): HTMLLegendElement; - createElement(tagName: "li"): HTMLLIElement; - createElement(tagName: "link"): HTMLLinkElement; - createElement(tagName: "listing"): HTMLBlockElement; - createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "marquee"): HTMLMarqueeElement; - createElement(tagName: "menu"): HTMLMenuElement; - createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nextid"): HTMLNextIdElement; - createElement(tagName: "nobr"): HTMLPhraseElement; - createElement(tagName: "object"): HTMLObjectElement; - createElement(tagName: "ol"): HTMLOListElement; - createElement(tagName: "optgroup"): HTMLOptGroupElement; - createElement(tagName: "option"): HTMLOptionElement; - createElement(tagName: "p"): HTMLParagraphElement; - createElement(tagName: "param"): HTMLParamElement; - createElement(tagName: "plaintext"): HTMLBlockElement; - createElement(tagName: "pre"): HTMLPreElement; - createElement(tagName: "progress"): HTMLProgressElement; - createElement(tagName: "q"): HTMLQuoteElement; - createElement(tagName: "rt"): HTMLPhraseElement; - createElement(tagName: "ruby"): HTMLPhraseElement; - createElement(tagName: "s"): HTMLPhraseElement; - createElement(tagName: "samp"): HTMLPhraseElement; - createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "select"): HTMLSelectElement; - createElement(tagName: "small"): HTMLPhraseElement; - createElement(tagName: "source"): HTMLSourceElement; - createElement(tagName: "span"): HTMLSpanElement; - createElement(tagName: "strike"): HTMLPhraseElement; - createElement(tagName: "strong"): HTMLPhraseElement; - createElement(tagName: "style"): HTMLStyleElement; - createElement(tagName: "sub"): HTMLPhraseElement; - createElement(tagName: "sup"): HTMLPhraseElement; - createElement(tagName: "table"): HTMLTableElement; - createElement(tagName: "tbody"): HTMLTableSectionElement; - createElement(tagName: "td"): HTMLTableDataCellElement; - createElement(tagName: "textarea"): HTMLTextAreaElement; - createElement(tagName: "tfoot"): HTMLTableSectionElement; - createElement(tagName: "th"): HTMLTableHeaderCellElement; - createElement(tagName: "thead"): HTMLTableSectionElement; - createElement(tagName: "title"): HTMLTitleElement; - createElement(tagName: "tr"): HTMLTableRowElement; - createElement(tagName: "track"): HTMLTrackElement; - createElement(tagName: "tt"): HTMLPhraseElement; - createElement(tagName: "u"): HTMLPhraseElement; - createElement(tagName: "ul"): HTMLUListElement; - createElement(tagName: "var"): HTMLPhraseElement; - createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; - createElement(tagName: "xmp"): HTMLBlockElement; - createElement(tagName: string): HTMLElement; - createElementNS(namespaceURI: string, qualifiedName: string): Element; - 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. - * @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. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - 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. - */ - createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; - createTouchList(...touches: Touch[]): TouchList; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - exitFullscreen(): void; - exitPointerLock(): void; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - /** - * 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; - getElementsByClassName(classNames: string): NodeList; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(tagname: "a"): NodeListOf; - getElementsByTagName(tagname: "abbr"): NodeListOf; - getElementsByTagName(tagname: "acronym"): NodeListOf; - getElementsByTagName(tagname: "address"): NodeListOf; - getElementsByTagName(tagname: "applet"): NodeListOf; - getElementsByTagName(tagname: "area"): NodeListOf; - getElementsByTagName(tagname: "article"): NodeListOf; - getElementsByTagName(tagname: "aside"): NodeListOf; - getElementsByTagName(tagname: "audio"): NodeListOf; - getElementsByTagName(tagname: "b"): NodeListOf; - getElementsByTagName(tagname: "base"): NodeListOf; - getElementsByTagName(tagname: "basefont"): NodeListOf; - getElementsByTagName(tagname: "bdo"): NodeListOf; - getElementsByTagName(tagname: "big"): NodeListOf; - getElementsByTagName(tagname: "blockquote"): NodeListOf; - getElementsByTagName(tagname: "body"): NodeListOf; - getElementsByTagName(tagname: "br"): NodeListOf; - getElementsByTagName(tagname: "button"): NodeListOf; - getElementsByTagName(tagname: "canvas"): NodeListOf; - getElementsByTagName(tagname: "caption"): NodeListOf; - getElementsByTagName(tagname: "center"): NodeListOf; - getElementsByTagName(tagname: "circle"): NodeListOf; - getElementsByTagName(tagname: "cite"): NodeListOf; - getElementsByTagName(tagname: "clippath"): NodeListOf; - getElementsByTagName(tagname: "code"): NodeListOf; - getElementsByTagName(tagname: "col"): NodeListOf; - getElementsByTagName(tagname: "colgroup"): NodeListOf; - getElementsByTagName(tagname: "datalist"): NodeListOf; - getElementsByTagName(tagname: "dd"): NodeListOf; - getElementsByTagName(tagname: "defs"): NodeListOf; - getElementsByTagName(tagname: "del"): NodeListOf; - getElementsByTagName(tagname: "desc"): NodeListOf; - getElementsByTagName(tagname: "dfn"): NodeListOf; - getElementsByTagName(tagname: "dir"): NodeListOf; - getElementsByTagName(tagname: "div"): NodeListOf; - getElementsByTagName(tagname: "dl"): NodeListOf; - getElementsByTagName(tagname: "dt"): NodeListOf; - getElementsByTagName(tagname: "ellipse"): NodeListOf; - getElementsByTagName(tagname: "em"): NodeListOf; - getElementsByTagName(tagname: "embed"): NodeListOf; - getElementsByTagName(tagname: "feblend"): NodeListOf; - getElementsByTagName(tagname: "fecolormatrix"): NodeListOf; - getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf; - getElementsByTagName(tagname: "fecomposite"): NodeListOf; - getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf; - getElementsByTagName(tagname: "fediffuselighting"): NodeListOf; - getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf; - getElementsByTagName(tagname: "fedistantlight"): NodeListOf; - getElementsByTagName(tagname: "feflood"): NodeListOf; - getElementsByTagName(tagname: "fefunca"): NodeListOf; - getElementsByTagName(tagname: "fefuncb"): NodeListOf; - getElementsByTagName(tagname: "fefuncg"): NodeListOf; - getElementsByTagName(tagname: "fefuncr"): NodeListOf; - getElementsByTagName(tagname: "fegaussianblur"): NodeListOf; - getElementsByTagName(tagname: "feimage"): NodeListOf; - getElementsByTagName(tagname: "femerge"): NodeListOf; - getElementsByTagName(tagname: "femergenode"): NodeListOf; - getElementsByTagName(tagname: "femorphology"): NodeListOf; - getElementsByTagName(tagname: "feoffset"): NodeListOf; - getElementsByTagName(tagname: "fepointlight"): NodeListOf; - getElementsByTagName(tagname: "fespecularlighting"): NodeListOf; - getElementsByTagName(tagname: "fespotlight"): NodeListOf; - getElementsByTagName(tagname: "fetile"): NodeListOf; - getElementsByTagName(tagname: "feturbulence"): NodeListOf; - getElementsByTagName(tagname: "fieldset"): NodeListOf; - getElementsByTagName(tagname: "figcaption"): NodeListOf; - getElementsByTagName(tagname: "figure"): NodeListOf; - getElementsByTagName(tagname: "filter"): NodeListOf; - getElementsByTagName(tagname: "font"): NodeListOf; - getElementsByTagName(tagname: "footer"): NodeListOf; - getElementsByTagName(tagname: "foreignobject"): NodeListOf; - getElementsByTagName(tagname: "form"): NodeListOf; - getElementsByTagName(tagname: "frame"): NodeListOf; - getElementsByTagName(tagname: "frameset"): NodeListOf; - getElementsByTagName(tagname: "g"): NodeListOf; - getElementsByTagName(tagname: "h1"): NodeListOf; - getElementsByTagName(tagname: "h2"): NodeListOf; - getElementsByTagName(tagname: "h3"): NodeListOf; - getElementsByTagName(tagname: "h4"): NodeListOf; - getElementsByTagName(tagname: "h5"): NodeListOf; - getElementsByTagName(tagname: "h6"): NodeListOf; - getElementsByTagName(tagname: "head"): NodeListOf; - getElementsByTagName(tagname: "header"): NodeListOf; - getElementsByTagName(tagname: "hgroup"): NodeListOf; - getElementsByTagName(tagname: "hr"): NodeListOf; - getElementsByTagName(tagname: "html"): NodeListOf; - getElementsByTagName(tagname: "i"): NodeListOf; - getElementsByTagName(tagname: "iframe"): NodeListOf; - getElementsByTagName(tagname: "image"): NodeListOf; - getElementsByTagName(tagname: "img"): NodeListOf; - getElementsByTagName(tagname: "input"): NodeListOf; - getElementsByTagName(tagname: "ins"): NodeListOf; - getElementsByTagName(tagname: "isindex"): NodeListOf; - getElementsByTagName(tagname: "kbd"): NodeListOf; - getElementsByTagName(tagname: "keygen"): NodeListOf; - getElementsByTagName(tagname: "label"): NodeListOf; - getElementsByTagName(tagname: "legend"): NodeListOf; - getElementsByTagName(tagname: "li"): NodeListOf; - getElementsByTagName(tagname: "line"): NodeListOf; - getElementsByTagName(tagname: "lineargradient"): NodeListOf; - getElementsByTagName(tagname: "link"): NodeListOf; - getElementsByTagName(tagname: "listing"): NodeListOf; - getElementsByTagName(tagname: "map"): NodeListOf; - getElementsByTagName(tagname: "mark"): NodeListOf; - getElementsByTagName(tagname: "marker"): NodeListOf; - getElementsByTagName(tagname: "marquee"): NodeListOf; - getElementsByTagName(tagname: "mask"): NodeListOf; - getElementsByTagName(tagname: "menu"): NodeListOf; - getElementsByTagName(tagname: "meta"): NodeListOf; - getElementsByTagName(tagname: "metadata"): NodeListOf; - getElementsByTagName(tagname: "nav"): NodeListOf; - getElementsByTagName(tagname: "nextid"): NodeListOf; - getElementsByTagName(tagname: "nobr"): NodeListOf; - getElementsByTagName(tagname: "noframes"): NodeListOf; - getElementsByTagName(tagname: "noscript"): NodeListOf; - getElementsByTagName(tagname: "object"): NodeListOf; - getElementsByTagName(tagname: "ol"): NodeListOf; - getElementsByTagName(tagname: "optgroup"): NodeListOf; - getElementsByTagName(tagname: "option"): NodeListOf; - getElementsByTagName(tagname: "p"): NodeListOf; - getElementsByTagName(tagname: "param"): NodeListOf; - getElementsByTagName(tagname: "path"): NodeListOf; - getElementsByTagName(tagname: "pattern"): NodeListOf; - getElementsByTagName(tagname: "plaintext"): NodeListOf; - getElementsByTagName(tagname: "polygon"): NodeListOf; - getElementsByTagName(tagname: "polyline"): NodeListOf; - getElementsByTagName(tagname: "pre"): NodeListOf; - getElementsByTagName(tagname: "progress"): NodeListOf; - getElementsByTagName(tagname: "q"): NodeListOf; - getElementsByTagName(tagname: "radialgradient"): NodeListOf; - getElementsByTagName(tagname: "rect"): NodeListOf; - getElementsByTagName(tagname: "rt"): NodeListOf; - getElementsByTagName(tagname: "ruby"): NodeListOf; - getElementsByTagName(tagname: "s"): NodeListOf; - getElementsByTagName(tagname: "samp"): NodeListOf; - getElementsByTagName(tagname: "script"): NodeListOf; - getElementsByTagName(tagname: "section"): NodeListOf; - getElementsByTagName(tagname: "select"): NodeListOf; - getElementsByTagName(tagname: "small"): NodeListOf; - getElementsByTagName(tagname: "source"): NodeListOf; - getElementsByTagName(tagname: "span"): NodeListOf; - getElementsByTagName(tagname: "stop"): NodeListOf; - getElementsByTagName(tagname: "strike"): NodeListOf; - getElementsByTagName(tagname: "strong"): NodeListOf; - getElementsByTagName(tagname: "style"): NodeListOf; - getElementsByTagName(tagname: "sub"): NodeListOf; - getElementsByTagName(tagname: "sup"): NodeListOf; - getElementsByTagName(tagname: "svg"): NodeListOf; - getElementsByTagName(tagname: "switch"): NodeListOf; - getElementsByTagName(tagname: "symbol"): NodeListOf; - getElementsByTagName(tagname: "table"): NodeListOf; - getElementsByTagName(tagname: "tbody"): NodeListOf; - getElementsByTagName(tagname: "td"): NodeListOf; - getElementsByTagName(tagname: "text"): NodeListOf; - getElementsByTagName(tagname: "textpath"): NodeListOf; - getElementsByTagName(tagname: "textarea"): NodeListOf; - getElementsByTagName(tagname: "tfoot"): NodeListOf; - getElementsByTagName(tagname: "th"): NodeListOf; - getElementsByTagName(tagname: "thead"): NodeListOf; - getElementsByTagName(tagname: "title"): NodeListOf; - getElementsByTagName(tagname: "tr"): NodeListOf; - getElementsByTagName(tagname: "track"): NodeListOf; - getElementsByTagName(tagname: "tspan"): NodeListOf; - getElementsByTagName(tagname: "tt"): NodeListOf; - getElementsByTagName(tagname: "u"): NodeListOf; - getElementsByTagName(tagname: "ul"): NodeListOf; - getElementsByTagName(tagname: "use"): NodeListOf; - getElementsByTagName(tagname: "var"): NodeListOf; - getElementsByTagName(tagname: "video"): NodeListOf; - getElementsByTagName(tagname: "view"): NodeListOf; - getElementsByTagName(tagname: "wbr"): NodeListOf; - getElementsByTagName(tagname: "x-ms-webview"): NodeListOf; - getElementsByTagName(tagname: "xmp"): NodeListOf; - getElementsByTagName(tagname: string): NodeList; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - importNode(importedNode: Node, deep: boolean): Node; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - msGetPrintDocumentForNamedFlow(flowName: string): Document; - msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): Document | Window; - /** - * 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. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - 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. - */ - queryCommandText(commandId: string): string; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - releaseEvents(): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - webkitCancelFullScreen(): void; - webkitExitFullscreen(): void; - /** - * 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. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Document: { - prototype: Document; - new(): Document; -} - -interface DocumentFragment extends Node, NodeSelector { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface DocumentType extends Node, ChildNode { - entities: NamedNodeMap; - internalSubset: string; - name: string; - notations: NamedNodeMap; - publicId: string; - systemId: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} - -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface DynamicsCompressorNode extends AudioNode { - attack: AudioParam; - knee: AudioParam; - ratio: AudioParam; - reduction: AudioParam; - release: AudioParam; - threshold: AudioParam; -} - -declare var DynamicsCompressorNode: { - prototype: DynamicsCompressorNode; - new(): DynamicsCompressorNode; -} - -interface EXT_texture_filter_anisotropic { - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; - TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode { - classList: DOMTokenList; - clientHeight: number; - clientLeft: number; - clientTop: number; - clientWidth: number; - msContentZoomFactor: number; - msRegionOverflow: string; - onariarequest: (ev: AriaRequestEvent) => any; - oncommand: (ev: CommandEvent) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onlostpointercapture: (ev: PointerEvent) => any; - onmsgesturechange: (ev: MSGestureEvent) => any; - onmsgesturedoubletap: (ev: MSGestureEvent) => any; - onmsgestureend: (ev: MSGestureEvent) => any; - onmsgesturehold: (ev: MSGestureEvent) => any; - onmsgesturestart: (ev: MSGestureEvent) => any; - onmsgesturetap: (ev: MSGestureEvent) => any; - onmsgotpointercapture: (ev: MSPointerEvent) => any; - onmsinertiastart: (ev: MSGestureEvent) => any; - onmslostpointercapture: (ev: MSPointerEvent) => any; - onmspointercancel: (ev: MSPointerEvent) => any; - onmspointerdown: (ev: MSPointerEvent) => any; - onmspointerenter: (ev: MSPointerEvent) => any; - onmspointerleave: (ev: MSPointerEvent) => any; - onmspointermove: (ev: MSPointerEvent) => any; - onmspointerout: (ev: MSPointerEvent) => any; - onmspointerover: (ev: MSPointerEvent) => any; - onmspointerup: (ev: MSPointerEvent) => any; - ontouchcancel: (ev: TouchEvent) => any; - ontouchend: (ev: TouchEvent) => any; - ontouchmove: (ev: TouchEvent) => any; - ontouchstart: (ev: TouchEvent) => any; - onwebkitfullscreenchange: (ev: Event) => any; - onwebkitfullscreenerror: (ev: Event) => any; - scrollHeight: number; - scrollLeft: number; - scrollTop: number; - scrollWidth: number; - tagName: string; - getAttribute(name?: string): string; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "circle"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "clippath"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "defs"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "desc"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "ellipse"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "feblend"): NodeListOf; - getElementsByTagName(name: "fecolormatrix"): NodeListOf; - getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; - getElementsByTagName(name: "fecomposite"): NodeListOf; - getElementsByTagName(name: "feconvolvematrix"): NodeListOf; - getElementsByTagName(name: "fediffuselighting"): NodeListOf; - getElementsByTagName(name: "fedisplacementmap"): NodeListOf; - getElementsByTagName(name: "fedistantlight"): NodeListOf; - getElementsByTagName(name: "feflood"): NodeListOf; - getElementsByTagName(name: "fefunca"): NodeListOf; - getElementsByTagName(name: "fefuncb"): NodeListOf; - getElementsByTagName(name: "fefuncg"): NodeListOf; - getElementsByTagName(name: "fefuncr"): NodeListOf; - getElementsByTagName(name: "fegaussianblur"): NodeListOf; - getElementsByTagName(name: "feimage"): NodeListOf; - getElementsByTagName(name: "femerge"): NodeListOf; - getElementsByTagName(name: "femergenode"): NodeListOf; - getElementsByTagName(name: "femorphology"): NodeListOf; - getElementsByTagName(name: "feoffset"): NodeListOf; - getElementsByTagName(name: "fepointlight"): NodeListOf; - getElementsByTagName(name: "fespecularlighting"): NodeListOf; - getElementsByTagName(name: "fespotlight"): NodeListOf; - getElementsByTagName(name: "fetile"): NodeListOf; - getElementsByTagName(name: "feturbulence"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "filter"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "foreignobject"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "g"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "image"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "line"): NodeListOf; - getElementsByTagName(name: "lineargradient"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marker"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "mask"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "metadata"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "path"): NodeListOf; - getElementsByTagName(name: "pattern"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "polygon"): NodeListOf; - getElementsByTagName(name: "polyline"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "radialgradient"): NodeListOf; - getElementsByTagName(name: "rect"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "source"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "stop"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "svg"): NodeListOf; - getElementsByTagName(name: "switch"): NodeListOf; - getElementsByTagName(name: "symbol"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "text"): NodeListOf; - getElementsByTagName(name: "textpath"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tspan"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "use"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "view"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttribute(name: string): boolean; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - msGetRegionContent(): MSRangeCollection; - msGetUntransformedBounds(): ClientRect; - msMatchesSelector(selectors: string): boolean; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - releasePointerCapture(pointerId: number): void; - removeAttribute(name?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - removeAttributeNode(oldAttr: Attr): Attr; - requestFullscreen(): void; - requestPointerLock(): void; - setAttribute(name?: string, value?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - setAttributeNode(newAttr: Attr): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - setPointerCapture(pointerId: number): void; - webkitMatchesSelector(selectors: string): boolean; - webkitRequestFullScreen(): void; - webkitRequestFullscreen(): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Element: { - prototype: Element; - new(): Element; -} - -interface ErrorEvent extends Event { - colno: number; - error: any; - filename: string; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} - -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface Event { - bubbles: boolean; - cancelBubble: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - returnValue: boolean; - srcElement: Element; - target: EventTarget; - timeStamp: number; - type: string; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - preventDefault(): void; - stopImmediatePropagation(): void; - stopPropagation(): void; - AT_TARGET: number; - BUBBLING_PHASE: number; - CAPTURING_PHASE: number; -} - -declare var Event: { - prototype: Event; - new(type: string, eventInitDict?: EventInit): Event; - AT_TARGET: number; - BUBBLING_PHASE: number; - CAPTURING_PHASE: number; -} - -interface EventTarget { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var EventTarget: { - prototype: EventTarget; - new(): EventTarget; -} - -interface External { -} - -declare var External: { - prototype: External; - new(): External; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} - -declare var File: { - prototype: File; - new(): File; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} - -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface FileReader extends EventTarget, MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} - -declare var FocusEvent: { - prototype: FocusEvent; - new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} - -declare var FormData: { - prototype: FormData; - new(): FormData; -} - -interface GainNode extends AudioNode { - gain: AudioParam; -} - -declare var GainNode: { - prototype: GainNode; - new(): GainNode; -} - -interface Gamepad { - axes: number[]; - buttons: GamepadButton[]; - connected: boolean; - id: string; - index: number; - mapping: string; - timestamp: number; -} - -declare var Gamepad: { - prototype: Gamepad; - new(): Gamepad; -} - -interface GamepadButton { - pressed: boolean; - value: number; -} - -declare var GamepadButton: { - prototype: GamepadButton; - new(): GamepadButton; -} - -interface GamepadEvent extends Event { - gamepad: Gamepad; -} - -declare var GamepadEvent: { - prototype: GamepadEvent; - new(): GamepadEvent; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} - -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; -} - -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -} - -interface HTMLAnchorElement extends HTMLElement { - Methods: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - mimeType: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - nameProp: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - protocolLong: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: 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; -} - -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLAppletElement extends HTMLElement { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - object: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - vspace: number; - width: number; -} - -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - rel: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} - -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: HTMLElement): void; - add(element: HTMLElement, before?: number): void; - /** - * Removes an element from the collection. - */ - remove(index?: number): void; -} - -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface HTMLAudioElement extends HTMLMediaElement { -} - -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} - -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; -} - -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLBlockElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - clear: string; - /** - * Sets or retrieves the width of the object. - */ - width: number; -} - -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface HTMLBodyElement extends HTMLElement { - aLink: any; - background: string; - bgColor: any; - bgProperties: string; - link: any; - noWrap: boolean; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onblur: (ev: FocusEvent) => any; - onerror: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - onhashchange: (ev: HashChangeEvent) => any; - onload: (ev: Event) => any; - onmessage: (ev: MessageEvent) => any; - onoffline: (ev: Event) => any; - ononline: (ev: Event) => any; - onorientationchange: (ev: Event) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpopstate: (ev: PopStateEvent) => any; - onresize: (ev: UIEvent) => any; - onstorage: (ev: StorageEvent) => any; - onunload: (ev: Event) => any; - text: any; - vLink: any; - createTextRange(): TextRange; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface HTMLButtonElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - status: any; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * 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; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @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; -} - -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface HTMLCollection { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Retrieves an object from various collections. - */ - item(nameOrIndex?: any, optionalIndex?: any): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - [index: number]: Element; -} - -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} - -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; -} - -interface HTMLDListElement extends HTMLElement { - compact: boolean; -} - -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} - -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} - -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface HTMLDirectoryElement extends HTMLElement { - compact: boolean; -} - -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface HTMLDivElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} - -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface HTMLDocument extends Document { -} - -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; -} - -interface HTMLElement extends Element { - accessKey: string; - children: HTMLCollection; - className: string; - contentEditable: string; - dataset: DOMStringMap; - dir: string; - draggable: boolean; - hidden: boolean; - hideFocus: boolean; - id: string; - innerHTML: string; - innerText: string; - isContentEditable: boolean; - lang: string; - offsetHeight: number; - offsetLeft: number; - offsetParent: Element; - offsetTop: number; - offsetWidth: number; - onabort: (ev: Event) => any; - onactivate: (ev: UIEvent) => any; - onbeforeactivate: (ev: UIEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onbeforedeactivate: (ev: UIEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - onblur: (ev: FocusEvent) => any; - oncanplay: (ev: Event) => any; - oncanplaythrough: (ev: Event) => any; - onchange: (ev: Event) => any; - onclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: PointerEvent) => any; - oncopy: (ev: DragEvent) => any; - oncuechange: (ev: Event) => any; - oncut: (ev: DragEvent) => any; - ondblclick: (ev: MouseEvent) => any; - ondeactivate: (ev: UIEvent) => any; - ondrag: (ev: DragEvent) => any; - ondragend: (ev: DragEvent) => any; - ondragenter: (ev: DragEvent) => any; - ondragleave: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrop: (ev: DragEvent) => any; - ondurationchange: (ev: Event) => any; - onemptied: (ev: Event) => any; - onended: (ev: Event) => any; - onerror: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - oninput: (ev: Event) => any; - onkeydown: (ev: KeyboardEvent) => any; - onkeypress: (ev: KeyboardEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onload: (ev: Event) => any; - onloadeddata: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onloadstart: (ev: Event) => any; - onmousedown: (ev: MouseEvent) => any; - onmouseenter: (ev: MouseEvent) => any; - onmouseleave: (ev: MouseEvent) => any; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onmouseover: (ev: MouseEvent) => any; - onmouseup: (ev: MouseEvent) => any; - onmousewheel: (ev: MouseWheelEvent) => any; - onmscontentzoom: (ev: UIEvent) => any; - onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; - onpaste: (ev: DragEvent) => any; - onpause: (ev: Event) => any; - onplay: (ev: Event) => any; - onplaying: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onratechange: (ev: Event) => any; - onreset: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onseeked: (ev: Event) => any; - onseeking: (ev: Event) => any; - onselect: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - onstalled: (ev: Event) => any; - onsubmit: (ev: Event) => any; - onsuspend: (ev: Event) => any; - ontimeupdate: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - onwaiting: (ev: Event) => any; - outerHTML: string; - outerText: string; - spellcheck: boolean; - style: CSSStyleDeclaration; - tabIndex: number; - title: string; - blur(): void; - click(): void; - contains(child: HTMLElement): boolean; - dragDrop(): boolean; - focus(): void; - getElementsByClassName(classNames: string): NodeList; - insertAdjacentElement(position: string, insertedElement: Element): Element; - insertAdjacentHTML(where: string, html: string): void; - insertAdjacentText(where: string, text: string): void; - msGetInputContext(): MSInputMethodContext; - scrollIntoView(top?: boolean): void; - setActive(): void; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the height of the object. - */ - height: string; - hidden: any; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - readyState: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface HTMLFormElement extends HTMLElement { - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - [name: string]: any; -} - -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument { - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string | number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the width of the object. - */ - width: string | number; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface HTMLFrameSetElement extends HTMLElement { - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - onerror: (ev: Event) => any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onhashchange: (ev: HashChangeEvent) => any; - onload: (ev: Event) => any; - onmessage: (ev: MessageEvent) => any; - onoffline: (ev: Event) => any; - ononline: (ev: Event) => any; - onorientationchange: (ev: Event) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onresize: (ev: UIEvent) => any; - onstorage: (ev: StorageEvent) => any; - onunload: (ev: Event) => any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; - /** - * Sets or retrieves the width of the object. - */ - width: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} - -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - clear: string; -} - -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} - -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - allowFullscreen: boolean; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - sandbox: DOMSettableTokenList; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface HTMLImageElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - crossOrigin: string; - currentSrc: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * The original width of the image resource before sizing. - */ - naturalWidth: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - srcset: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: number; - x: number; - y: number; - msGetAsCastingSource(): any; -} - -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLInputElement extends HTMLElement { - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - indeterminate: boolean; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - list: HTMLElement; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - size: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - status: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - valueAsDate: Date; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; -} - -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - prompt: string; -} - -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface HTMLLIElement extends HTMLElement { - type: string; - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} - -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface HTMLLabelElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; -} - -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface HTMLLegendElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} - -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - disabled: boolean; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; - /** - * Sets or retrieves the name of the object. - */ - name: string; -} - -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMarqueeElement extends HTMLElement { - behavior: string; - bgColor: any; - direction: string; - height: string; - hspace: number; - loop: number; - onbounce: (ev: Event) => any; - onfinish: (ev: Event) => any; - onstart: (ev: Event) => any; - scrollAmount: number; - scrollDelay: number; - trueSpeed: boolean; - vspace: number; - width: string; - start(): void; - stop(): void; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface HTMLMediaElement extends HTMLElement { - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - defaultMuted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets the current network activity for the element. - */ - networkState: number; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - readyState: any; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - textTracks: TextTrackList; - videoTracks: VideoTrackList; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - msGetAsCastingSource(): any; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - HAVE_CURRENT_DATA: number; - HAVE_ENOUGH_DATA: number; - HAVE_FUTURE_DATA: number; - HAVE_METADATA: number; - HAVE_NOTHING: number; - NETWORK_EMPTY: number; - NETWORK_IDLE: number; - NETWORK_LOADING: number; - NETWORK_NO_SOURCE: number; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_CURRENT_DATA: number; - HAVE_ENOUGH_DATA: number; - HAVE_FUTURE_DATA: number; - HAVE_METADATA: number; - HAVE_NOTHING: number; - NETWORK_EMPTY: number; - NETWORK_IDLE: number; - NETWORK_LOADING: number; - NETWORK_NO_SOURCE: number; -} - -interface HTMLMenuElement extends HTMLElement { - compact: boolean; - type: string; -} - -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; -} - -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; -} - -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface HTMLNextIdElement extends HTMLElement { - n: string; -} - -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; -} - -interface HTMLOListElement extends HTMLElement { - compact: boolean; - /** - * The starting number. - */ - start: number; - type: string; -} - -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument { - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - border: string; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - declare: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the height of the object. - */ - height: string; - hspace: number; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the contained object. - */ - object: any; - readyState: number; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - vspace: number; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLOptGroupElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; -} - -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLOptionElement extends HTMLElement { - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; -} - -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLParagraphElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - clear: string; -} - -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} - -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; -} - -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface HTMLPreElement extends HTMLElement { - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; - clear: string; - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; -} - -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; -} - -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves reference information about the object. - */ - cite: string; - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; -} - -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface HTMLScriptElement extends HTMLElement { - async: boolean; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * 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; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; -} - -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLSelectElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Sets or retrieves the name of the object. - */ - name: string; - options: HTMLSelectElement; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * 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. - */ - add(element: HTMLElement, before?: HTMLElement): void; - add(element: HTMLElement, before?: number): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - [name: string]: any; -} - -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - msKeySystem: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; -} - -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface HTMLSpanElement extends HTMLElement { -} - -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; -} - -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - bgColor: any; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the width of the object. - */ - width: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; - /** - * Sets or retrieves the width of the object. - */ - width: any; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} - -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLTableElement extends HTMLElement { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - bgColor: any; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; -} - -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} - -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - bgColor: any; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLElement; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface HTMLTextAreaElement extends HTMLElement { - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - disabled: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; -} - -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; -} - -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface HTMLTrackElement extends HTMLElement { - default: boolean; - kind: string; - label: string; - readyState: number; - src: string; - srclang: string; - track: TextTrack; - ERROR: number; - LOADED: number; - LOADING: number; - NONE: number; -} - -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - ERROR: number; - LOADED: number; - LOADING: number; - NONE: number; -} - -interface HTMLUListElement extends HTMLElement { - compact: boolean; - type: string; -} - -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface HTMLUnknownElement extends HTMLElement { -} - -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the height of the video element. - */ - height: number; - msHorizontalMirror: boolean; - msIsLayoutOptimalForPlayback: boolean; - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - msStereo3DRenderMode: string; - msZoom: boolean; - onMSVideoFormatChanged: (ev: Event) => any; - onMSVideoFrameStepCompleted: (ev: Event) => any; - onMSVideoOptimalLayoutChanged: (ev: Event) => any; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - webkitDisplayingFullscreen: boolean; - webkitSupportsFullscreen: boolean; - /** - * Gets or sets the width of the video element. - */ - width: number; - getVideoPlaybackQuality(): VideoPlaybackQuality; - msFrameStep(forward: boolean): void; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - webkitEnterFullScreen(): void; - webkitEnterFullscreen(): void; - webkitExitFullScreen(): void; - webkitExitFullscreen(): void; - addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface HashChangeEvent extends Event { - newURL: string; - oldURL: string; -} - -declare var HashChangeEvent: { - prototype: HashChangeEvent; - new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; -} - -interface History { - length: number; - state: any; - back(distance?: any): void; - forward(distance?: any): void; - go(delta?: any): void; - pushState(statedata: any, title?: string, url?: string): void; - replaceState(statedata: any, title?: string, url?: string): void; -} - -declare var History: { - prototype: History; - new(): History; -} - -interface IDBCursor { - direction: string; - key: any; - primaryKey: any; - source: any; - advance(count: number): void; - continue(key?: any): void; - delete(): IDBRequest; - update(value: any): IDBRequest; - NEXT: string; - NEXT_NO_DUPLICATE: string; - PREV: string; - PREV_NO_DUPLICATE: string; -} - -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - NEXT: string; - NEXT_NO_DUPLICATE: string; - PREV: string; - PREV_NO_DUPLICATE: string; -} - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} - -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface IDBDatabase extends EventTarget { - name: string; - objectStoreNames: DOMStringList; - onabort: (ev: Event) => any; - onerror: (ev: Event) => any; - version: string; - close(): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - deleteObjectStore(name: string): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface IDBFactory { - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; - open(name: string, version?: number): IDBOpenDBRequest; -} - -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface IDBIndex { - keyPath: string; - name: string; - objectStore: IDBObjectStore; - unique: boolean; - count(key?: any): IDBRequest; - get(key: any): IDBRequest; - getKey(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} - -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface IDBKeyRange { - lower: any; - lowerOpen: boolean; - upper: any; - upperOpen: boolean; -} - -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - keyPath: string; - name: string; - transaction: IDBTransaction; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - delete(key: any): IDBRequest; - deleteIndex(indexName: string): void; - get(key: any): IDBRequest; - index(name: string): IDBIndex; - openCursor(range?: any, direction?: string): IDBRequest; - put(value: any, key?: any): IDBRequest; -} - -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBOpenDBRequest extends IDBRequest { - onblocked: (ev: Event) => any; - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface IDBRequest extends EventTarget { - error: DOMError; - onerror: (ev: Event) => any; - onsuccess: (ev: Event) => any; - readyState: string; - result: any; - source: any; - transaction: IDBTransaction; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface IDBTransaction extends EventTarget { - db: IDBDatabase; - error: DOMError; - mode: string; - onabort: (ev: Event) => any; - oncomplete: (ev: Event) => any; - onerror: (ev: Event) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - READ_WRITE: string; - VERSION_CHANGE: string; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - READ_WRITE: string; - VERSION_CHANGE: string; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} - -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface ImageData { - data: number[]; - height: number; - width: number; -} - -declare var ImageData: { - prototype: ImageData; - new(): ImageData; -} - -interface KeyboardEvent extends UIEvent { - altKey: boolean; - char: string; - charCode: number; - ctrlKey: boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_MOBILE: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; -} - -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_MOBILE: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; -} - -interface Location { - hash: string; - host: string; - hostname: string; - href: string; - origin: string; - pathname: string; - port: string; - protocol: string; - search: string; - assign(url: string): void; - reload(forcedReload?: boolean): void; - replace(url: string): void; - toString(): string; -} - -declare var Location: { - prototype: Location; - new(): Location; -} - -interface LongRunningScriptDetectedEvent extends Event { - executionTime: number; - stopPageScriptExecution: boolean; -} - -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; -} - -interface MSApp { - clearTemporaryWebDataAsync(): MSAppAsyncOperation; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createDataPackage(object: any): any; - createDataPackageFromSelection(): any; - createFileFromStorageFile(storageFile: any): File; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - getCurrentPriority(): string; - getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; - getViewId(view: any): any; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - pageHandlesAllApplicationActivations(enabled: boolean): void; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - terminateApp(exceptionObject: any): void; - CURRENT: string; - HIGH: string; - IDLE: string; - NORMAL: string; -} -declare var MSApp: MSApp; - -interface MSAppAsyncOperation extends EventTarget { - error: DOMError; - oncomplete: (ev: Event) => any; - onerror: (ev: Event) => any; - readyState: number; - result: any; - start(): void; - COMPLETED: number; - ERROR: number; - STARTED: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSAppAsyncOperation: { - prototype: MSAppAsyncOperation; - new(): MSAppAsyncOperation; - COMPLETED: number; - ERROR: number; - STARTED: number; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} - -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface MSCSSMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - inverse(): MSCSSMatrix; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - setMatrixValue(value: string): void; - skewX(angle: number): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - toString(): string; - translate(x: number, y: number, z?: number): MSCSSMatrix; -} - -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new(text?: string): MSCSSMatrix; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} - -declare var MSGesture: { - prototype: MSGesture; - new(): MSGesture; -} - -interface MSGestureEvent extends UIEvent { - clientX: number; - clientY: number; - expansion: number; - gestureObject: any; - hwTimestamp: number; - offsetX: number; - offsetY: number; - rotation: number; - scale: number; - screenX: number; - screenY: number; - translationX: number; - translationY: number; - velocityAngular: number; - velocityExpansion: number; - velocityX: number; - velocityY: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} - -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} - -interface MSGraphicsTrust { - constrictionActive: boolean; - status: string; -} - -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; -} - -interface MSHTMLWebViewElement extends HTMLElement { - canGoBack: boolean; - canGoForward: boolean; - containsFullScreenElement: boolean; - documentTitle: string; - height: number; - settings: MSWebViewSettings; - src: string; - width: number; - addWebAllowedObject(name: string, applicationObject: any): void; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; - getDeferredPermissionRequests(): DeferredPermissionRequest[]; - goBack(): void; - goForward(): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - navigate(uri: string): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - navigateToString(contents: string): void; - navigateWithHttpRequestMessage(requestMessage: any): void; - refresh(): void; - stop(): void; -} - -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; -} - -interface MSHeaderFooter { - URL: string; - dateLong: string; - dateShort: string; - font: string; - htmlFoot: string; - htmlHead: string; - page: number; - pageTotal: number; - textFoot: string; - textHead: string; - timeLong: string; - timeShort: string; - title: string; -} - -declare var MSHeaderFooter: { - prototype: MSHeaderFooter; - new(): MSHeaderFooter; -} - -interface MSInputMethodContext extends EventTarget { - compositionEndOffset: number; - compositionStartOffset: number; - oncandidatewindowhide: (ev: Event) => any; - oncandidatewindowshow: (ev: Event) => any; - oncandidatewindowupdate: (ev: Event) => any; - target: HTMLElement; - getCandidateWindowClientRect(): ClientRect; - getCompositionAlternatives(): string[]; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "MSCandidateWindowHide", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSCandidateWindowShow", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "MSCandidateWindowUpdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface MSManipulationEvent extends UIEvent { - currentState: number; - inertiaDestinationX: number; - inertiaDestinationY: number; - lastState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_CANCELLED: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_STOPPED: number; -} - -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_CANCELLED: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_STOPPED: number; -} - -interface MSMediaKeyError { - code: number; - systemCode: number; - MS_MEDIA_KEYERR_CLIENT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_UNKNOWN: number; -} - -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - MS_MEDIA_KEYERR_CLIENT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_UNKNOWN: number; -} - -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} - -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -} - -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} - -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -} - -interface MSMediaKeySession extends EventTarget { - error: MSMediaKeyError; - keySystem: string; - sessionId: string; - close(): void; - update(key: Uint8Array): void; -} - -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; -} - -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} - -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; -} - -interface MSMimeTypesCollection { - length: number; -} - -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} - -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface MSPointerEvent extends MouseEvent { - currentPoint: any; - height: number; - hwTimestamp: number; - intermediatePoints: any; - isPrimary: boolean; - pointerId: number; - pointerType: any; - pressure: number; - rotation: number; - tiltX: number; - tiltY: number; - width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; -} - -interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget { - percentScale: number; - showHeaderFooter: boolean; - shrinkToFit: boolean; - drawPreviewPage(element: HTMLElement, pageNumber: number): void; - endPrint(): void; - getPrintTaskOptionValue(key: string): any; - invalidatePreview(): void; - setPageCount(pageCount: number): void; - startPrint(): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSPrintManagerTemplatePrinter: { - prototype: MSPrintManagerTemplatePrinter; - new(): MSPrintManagerTemplatePrinter; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} - -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface MSSiteModeEvent extends Event { - actionURL: string; - buttonID: number; -} - -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface MSStream { - type: string; - msClose(): void; - msDetachStream(): any; -} - -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSStreamReader extends EventTarget, MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBinaryString(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MSTemplatePrinter { - collate: boolean; - copies: number; - currentPage: boolean; - currentPageAvail: boolean; - duplex: boolean; - footer: string; - frameActive: boolean; - frameActiveEnabled: boolean; - frameAsShown: boolean; - framesetDocument: boolean; - header: string; - headerFooterFont: string; - marginBottom: number; - marginLeft: number; - marginRight: number; - marginTop: number; - orientation: string; - pageFrom: number; - pageHeight: number; - pageTo: number; - pageWidth: number; - selectedPages: boolean; - selection: boolean; - selectionEnabled: boolean; - unprintableBottom: number; - unprintableLeft: number; - unprintableRight: number; - unprintableTop: number; - usePrinterCopyCollate: boolean; - createHeaderFooter(): MSHeaderFooter; - deviceSupports(property: string): any; - ensurePrintDialogDefaults(): boolean; - getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; - getPageMarginBottomImportant(pageRule: CSSPageRule): boolean; - getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; - getPageMarginLeftImportant(pageRule: CSSPageRule): boolean; - getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; - getPageMarginRightImportant(pageRule: CSSPageRule): boolean; - getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; - getPageMarginTopImportant(pageRule: CSSPageRule): boolean; - printBlankPage(): void; - printNonNative(document: any): boolean; - printNonNativeFrames(document: any, activeFrame: boolean): void; - printPage(element: HTMLElement): void; - showPageSetupDialog(): boolean; - showPrintDialog(): boolean; - startDoc(title: string): boolean; - stopDoc(): void; - updatePageStatus(status: number): void; -} - -declare var MSTemplatePrinter: { - prototype: MSTemplatePrinter; - new(): MSTemplatePrinter; -} - -interface MSWebViewAsyncOperation extends EventTarget { - error: DOMError; - oncomplete: (ev: Event) => any; - onerror: (ev: Event) => any; - readyState: number; - result: any; - target: MSHTMLWebViewElement; - type: number; - start(): void; - COMPLETED: number; - ERROR: number; - STARTED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; - COMPLETED: number; - ERROR: number; - STARTED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; -} - -interface MSWebViewSettings { - isIndexedDBEnabled: boolean; - isJavaScriptEnabled: boolean; -} - -declare var MSWebViewSettings: { - prototype: MSWebViewSettings; - new(): MSWebViewSettings; -} - -interface MediaElementAudioSourceNode extends AudioNode { -} - -declare var MediaElementAudioSourceNode: { - prototype: MediaElementAudioSourceNode; - new(): MediaElementAudioSourceNode; -} - -interface MediaError { - code: number; - msExtendedCode: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_DECODE: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_DECODE: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface MediaList { - length: number; - mediaText: string; - appendMedium(newMedium: string): void; - deleteMedium(oldMedium: string): void; - item(index: number): string; - toString(): string; - [index: number]: string; -} - -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface MediaQueryList { - matches: boolean; - media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} - -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface MediaSource extends EventTarget { - activeSourceBuffers: SourceBufferList; - duration: number; - readyState: string; - sourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} - -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - -interface MessageChannel { - port1: MessagePort; - port2: MessagePort; -} - -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface MessageEvent extends Event { - data: any; - origin: string; - ports: any; - source: Window; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} - -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface MessagePort extends EventTarget { - onmessage: (ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface MimeType { - description: string; - enabledPlugin: Plugin; - suffixes: string; - type: string; -} - -declare var MimeType: { - prototype: MimeType; - new(): MimeType; -} - -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - namedItem(type: string): Plugin; - [index: number]: Plugin; -} - -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; -} - -interface MouseEvent extends UIEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - fromElement: Element; - layerX: number; - layerY: number; - metaKey: boolean; - movementX: number; - movementY: number; - offsetX: number; - offsetY: number; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - toElement: Element; - which: number; - x: number; - y: number; - getModifierState(keyArg: string): boolean; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; -} - -declare var MouseEvent: { - prototype: MouseEvent; - new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - wheelDeltaX: number; - wheelDeltaY: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} - -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface MutationEvent extends Event { - attrChange: number; - attrName: string; - newValue: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - ADDITION: number; - MODIFICATION: number; - REMOVAL: number; -} - -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - ADDITION: number; - MODIFICATION: number; - REMOVAL: number; -} - -interface MutationObserver { - disconnect(): void; - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; -} - -declare var MutationObserver: { - prototype: MutationObserver; - new(callback: MutationCallback): MutationObserver; -} - -interface MutationRecord { - addedNodes: NodeList; - attributeName: string; - attributeNamespace: string; - nextSibling: Node; - oldValue: string; - previousSibling: Node; - removedNodes: NodeList; - target: Node; - type: string; -} - -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; -} - -interface NamedNodeMap { - length: number; - getNamedItem(name: string): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - removeNamedItem(name: string): Attr; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItem(arg: Attr): Attr; - setNamedItemNS(arg: Attr): Attr; - [index: number]: Attr; -} - -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface NavigationCompletedEvent extends NavigationEvent { - isSuccess: boolean; - webErrorStatus: number; -} - -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; -} - -interface NavigationEvent extends Event { - uri: string; -} - -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; -} - -interface NavigationEventWithReferrer extends NavigationEvent { - referer: string; -} - -declare var NavigationEventWithReferrer: { - prototype: NavigationEventWithReferrer; - new(): NavigationEventWithReferrer; -} - -interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver { - appCodeName: string; - appMinorVersion: string; - browserLanguage: string; - connectionSpeed: number; - cookieEnabled: boolean; - cpuClass: string; - language: string; - maxTouchPoints: number; - mimeTypes: MSMimeTypesCollection; - msManipulationViewsEnabled: boolean; - msMaxTouchPoints: number; - msPointerEnabled: boolean; - plugins: MSPluginsCollection; - pointerEnabled: boolean; - systemLanguage: string; - userLanguage: string; - webdriver: boolean; - getGamepads(): Gamepad[]; - javaEnabled(): boolean; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface Node extends EventTarget { - attributes: NamedNodeMap; - baseURI: string; - childNodes: NodeList; - firstChild: Node; - lastChild: Node; - localName: string; - namespaceURI: string; - nextSibling: Node; - nodeName: string; - nodeType: number; - nodeValue: string; - ownerDocument: Document; - parentElement: HTMLElement; - parentNode: Node; - prefix: string; - previousSibling: Node; - textContent: string; - appendChild(newChild: Node): Node; - cloneNode(deep?: boolean): Node; - compareDocumentPosition(other: Node): number; - hasAttributes(): boolean; - hasChildNodes(): boolean; - insertBefore(newChild: Node, refChild?: Node): Node; - isDefaultNamespace(namespaceURI: string): boolean; - isEqualNode(arg: Node): boolean; - isSameNode(other: Node): boolean; - lookupNamespaceURI(prefix: string): string; - lookupPrefix(namespaceURI: string): string; - normalize(): void; - removeChild(oldChild: Node): Node; - replaceChild(newChild: Node, oldChild: Node): Node; - ATTRIBUTE_NODE: number; - CDATA_SECTION_NODE: number; - COMMENT_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - DOCUMENT_NODE: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_POSITION_PRECEDING: number; - DOCUMENT_TYPE_NODE: number; - ELEMENT_NODE: number; - ENTITY_NODE: number; - ENTITY_REFERENCE_NODE: number; - NOTATION_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - TEXT_NODE: number; -} - -declare var Node: { - prototype: Node; - new(): Node; - ATTRIBUTE_NODE: number; - CDATA_SECTION_NODE: number; - COMMENT_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - DOCUMENT_NODE: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_POSITION_PRECEDING: number; - DOCUMENT_TYPE_NODE: number; - ELEMENT_NODE: number; - ENTITY_NODE: number; - ENTITY_REFERENCE_NODE: number; - NOTATION_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - TEXT_NODE: number; -} - -interface NodeFilter { - FILTER_ACCEPT: number; - FILTER_REJECT: number; - FILTER_SKIP: number; - SHOW_ALL: number; - SHOW_ATTRIBUTE: number; - SHOW_CDATA_SECTION: number; - SHOW_COMMENT: number; - SHOW_DOCUMENT: number; - SHOW_DOCUMENT_FRAGMENT: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_ELEMENT: number; - SHOW_ENTITY: number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_PROCESSING_INSTRUCTION: number; - SHOW_TEXT: number; -} -declare var NodeFilter: NodeFilter; - -interface NodeIterator { - expandEntityReferences: boolean; - filter: NodeFilter; - root: Node; - whatToShow: number; - detach(): void; - nextNode(): Node; - previousNode(): Node; -} - -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} - -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface OES_element_index_uint { -} - -declare var OES_element_index_uint: { - prototype: OES_element_index_uint; - new(): OES_element_index_uint; -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface OES_texture_float { -} - -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; -} - -interface OES_texture_float_linear { -} - -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface OfflineAudioCompletionEvent extends Event { - renderedBuffer: AudioBuffer; -} - -declare var OfflineAudioCompletionEvent: { - prototype: OfflineAudioCompletionEvent; - new(): OfflineAudioCompletionEvent; -} - -interface OfflineAudioContext extends AudioContext { - oncomplete: (ev: Event) => any; - startRendering(): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OfflineAudioContext: { - prototype: OfflineAudioContext; - new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; -} - -interface OscillatorNode extends AudioNode { - detune: AudioParam; - frequency: AudioParam; - onended: (ev: Event) => any; - type: string; - setPeriodicWave(periodicWave: PeriodicWave): void; - start(when?: number): void; - stop(when?: number): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var OscillatorNode: { - prototype: OscillatorNode; - new(): OscillatorNode; -} - -interface PageTransitionEvent extends Event { - persisted: boolean; -} - -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; -} - -interface PannerNode extends AudioNode { - coneInnerAngle: number; - coneOuterAngle: number; - coneOuterGain: number; - distanceModel: string; - maxDistance: number; - panningModel: string; - refDistance: number; - rolloffFactor: number; - setOrientation(x: number, y: number, z: number): void; - setPosition(x: number, y: number, z: number): void; - setVelocity(x: number, y: number, z: number): void; -} - -declare var PannerNode: { - prototype: PannerNode; - new(): PannerNode; -} - -interface PerfWidgetExternal { - activeNetworkRequestCount: number; - averageFrameTime: number; - averagePaintTime: number; - extraInformationEnabled: boolean; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - maxCpuSpeed: number; - paintRequestsPerSecond: number; - performanceCounter: number; - performanceCounterFrequency: number; - addEventListener(eventType: string, callback: Function): void; - getMemoryUsage(): number; - getProcessCpuUsage(): number; - getRecentCpuUsage(last: number): any; - getRecentFrames(last: number): any; - getRecentMemoryUsage(last: number): any; - getRecentPaintRequests(last: number): any; - removeEventListener(eventType: string, callback: Function): void; - repositionWindow(x: number, y: number): void; - resizeWindow(width: number, height: number): void; -} - -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - clearMarks(markName?: string): void; - clearMeasures(measureName?: string): void; - clearResourceTimings(): void; - getEntries(): any; - getEntriesByName(name: string, entryType?: string): any; - getEntriesByType(entryType: string): any; - getMarks(markName?: string): any; - getMeasures(measureName?: string): any; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - now(): number; - setResourceTimingBufferSize(maxSize: number): void; - toJSON(): any; -} - -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface PerformanceEntry { - duration: number; - entryType: string; - name: string; - startTime: number; -} - -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; -} - -interface PerformanceMark extends PerformanceEntry { -} - -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface PerformanceMeasure extends PerformanceEntry { -} - -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; - TYPE_RELOAD: number; - TYPE_RESERVED: number; -} - -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; - TYPE_RELOAD: number; - TYPE_RESERVED: number; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - connectEnd: number; - connectStart: number; - domComplete: number; - domContentLoadedEventEnd: number; - domContentLoadedEventStart: number; - domInteractive: number; - domLoading: number; - domainLookupEnd: number; - domainLookupStart: number; - fetchStart: number; - loadEventEnd: number; - loadEventStart: number; - navigationStart: number; - redirectCount: number; - redirectEnd: number; - redirectStart: number; - requestStart: number; - responseEnd: number; - responseStart: number; - type: string; - unloadEventEnd: number; - unloadEventStart: number; -} - -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - connectEnd: number; - connectStart: number; - domainLookupEnd: number; - domainLookupStart: number; - fetchStart: number; - initiatorType: string; - redirectEnd: number; - redirectStart: number; - requestStart: number; - responseEnd: number; - responseStart: number; -} - -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface PerformanceTiming { - connectEnd: number; - connectStart: number; - domComplete: number; - domContentLoadedEventEnd: number; - domContentLoadedEventStart: number; - domInteractive: number; - domLoading: number; - domainLookupEnd: number; - domainLookupStart: number; - fetchStart: number; - loadEventEnd: number; - loadEventStart: number; - msFirstPaint: number; - navigationStart: number; - redirectEnd: number; - redirectStart: number; - requestStart: number; - responseEnd: number; - responseStart: number; - unloadEventEnd: number; - unloadEventStart: number; - toJSON(): any; -} - -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface PeriodicWave { -} - -declare var PeriodicWave: { - prototype: PeriodicWave; - new(): PeriodicWave; -} - -interface PermissionRequest extends DeferredPermissionRequest { - state: string; - defer(): void; -} - -declare var PermissionRequest: { - prototype: PermissionRequest; - new(): PermissionRequest; -} - -interface PermissionRequestedEvent extends Event { - permissionRequest: PermissionRequest; -} - -declare var PermissionRequestedEvent: { - prototype: PermissionRequestedEvent; - new(): PermissionRequestedEvent; -} - -interface Plugin { - description: string; - filename: string; - length: number; - name: string; - version: string; - item(index: number): MimeType; - namedItem(type: string): MimeType; - [index: number]: MimeType; -} - -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface PluginArray { - length: number; - item(index: number): Plugin; - namedItem(name: string): Plugin; - refresh(reload?: boolean): void; - [index: number]: Plugin; -} - -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface PointerEvent extends MouseEvent { - currentPoint: any; - height: number; - hwTimestamp: number; - intermediatePoints: any; - isPrimary: boolean; - pointerId: number; - pointerType: any; - pressure: number; - rotation: number; - tiltX: number; - tiltY: number; - width: number; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; -} - -declare var PointerEvent: { - prototype: PointerEvent; - new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; -} - -interface PopStateEvent extends Event { - state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} - -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface Position { - coords: Coordinates; - timestamp: Date; -} - -declare var Position: { - prototype: Position; - new(): Position; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - PERMISSION_DENIED: number; - POSITION_UNAVAILABLE: number; - TIMEOUT: number; -} - -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - PERMISSION_DENIED: number; - POSITION_UNAVAILABLE: number; - TIMEOUT: number; -} - -interface ProcessingInstruction extends CharacterData { - target: string; -} - -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface ProgressEvent extends Event { - lengthComputable: boolean; - loaded: number; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} - -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface Range { - collapsed: boolean; - commonAncestorContainer: Node; - endContainer: Node; - endOffset: number; - startContainer: Node; - startOffset: number; - cloneContents(): DocumentFragment; - cloneRange(): Range; - collapse(toStart: boolean): void; - compareBoundaryPoints(how: number, sourceRange: Range): number; - createContextualFragment(fragment: string): DocumentFragment; - deleteContents(): void; - detach(): void; - expand(Unit: string): boolean; - extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - insertNode(newNode: Node): void; - selectNode(refNode: Node): void; - selectNodeContents(refNode: Node): void; - setEnd(refNode: Node, offset: number): void; - setEndAfter(refNode: Node): void; - setEndBefore(refNode: Node): void; - setStart(refNode: Node, offset: number): void; - setStartAfter(refNode: Node): void; - setStartBefore(refNode: Node): void; - surroundContents(newParent: Node): void; - toString(): string; - END_TO_END: number; - END_TO_START: number; - START_TO_END: number; - START_TO_START: number; -} - -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - END_TO_START: number; - START_TO_END: number; - START_TO_START: number; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGAngle { - unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; -} - -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} - -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} - -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} - -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} - -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} - -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} - -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} - -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} - -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} - -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} - -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} - -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} - -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - cy: SVGAnimatedLength; - r: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - clipPathUnits: SVGAnimatedEnumeration; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - amplitude: SVGAnimatedNumber; - exponent: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - slope: SVGAnimatedNumber; - tableValues: SVGAnimatedNumberList; - type: SVGAnimatedEnumeration; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface SVGElement extends Element { - id: string; - onclick: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusin: (ev: FocusEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onload: (ev: Event) => any; - onmousedown: (ev: MouseEvent) => any; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onmouseover: (ev: MouseEvent) => any; - onmouseup: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - viewportElement: SVGElement; - xmlbase: string; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface SVGElementInstance extends EventTarget { - childNodes: SVGElementInstanceList; - correspondingElement: SVGElement; - correspondingUseElement: SVGUseElement; - firstChild: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - parentNode: SVGElementInstance; - previousSibling: SVGElementInstance; -} - -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} - -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - cy: SVGAnimatedLength; - rx: SVGAnimatedLength; - ry: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - SVG_FEBLEND_MODE_COLOR: number; - SVG_FEBLEND_MODE_COLOR_BURN: number; - SVG_FEBLEND_MODE_COLOR_DODGE: number; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_DIFFERENCE: number; - SVG_FEBLEND_MODE_EXCLUSION: number; - SVG_FEBLEND_MODE_HARD_LIGHT: number; - SVG_FEBLEND_MODE_HUE: number; - SVG_FEBLEND_MODE_LIGHTEN: number; - SVG_FEBLEND_MODE_LUMINOSITY: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_OVERLAY: number; - SVG_FEBLEND_MODE_SATURATION: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_SOFT_LIGHT: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_COLOR: number; - SVG_FEBLEND_MODE_COLOR_BURN: number; - SVG_FEBLEND_MODE_COLOR_DODGE: number; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_DIFFERENCE: number; - SVG_FEBLEND_MODE_EXCLUSION: number; - SVG_FEBLEND_MODE_HARD_LIGHT: number; - SVG_FEBLEND_MODE_HUE: number; - SVG_FEBLEND_MODE_LIGHTEN: number; - SVG_FEBLEND_MODE_LUMINOSITY: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_OVERLAY: number; - SVG_FEBLEND_MODE_SATURATION: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_SOFT_LIGHT: number; - SVG_FEBLEND_MODE_UNKNOWN: number; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; -} - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - in2: SVGAnimatedString; - k1: SVGAnimatedNumber; - k2: SVGAnimatedNumber; - k3: SVGAnimatedNumber; - k4: SVGAnimatedNumber; - operator: SVGAnimatedEnumeration; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - bias: SVGAnimatedNumber; - divisor: SVGAnimatedNumber; - edgeMode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - kernelMatrix: SVGAnimatedNumberList; - kernelUnitLengthX: SVGAnimatedNumber; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - orderY: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_NONE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_WRAP: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_NONE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_WRAP: number; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - diffuseConstant: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - in2: SVGAnimatedString; - scale: SVGAnimatedNumber; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - SVG_CHANNEL_A: number; - SVG_CHANNEL_B: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_A: number; - SVG_CHANNEL_B: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_UNKNOWN: number; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} - -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} - -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - stdDeviationX: SVGAnimatedNumber; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} - -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dx: SVGAnimatedNumber; - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface SVGFEPointLightElement extends SVGElement { - x: SVGAnimatedNumber; - y: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} - -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - kernelUnitLengthY: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface SVGFESpotLightElement extends SVGElement { - limitingConeAngle: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; - pointsAtY: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - y: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} - -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - baseFrequencyY: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - seed: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - type: SVGAnimatedEnumeration; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_STITCHTYPE_STITCH: number; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_STITCHTYPE_STITCH: number; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - filterResX: SVGAnimatedInteger; - filterResY: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - height: SVGAnimatedLength; - primitiveUnits: SVGAnimatedEnumeration; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - setFilterRes(filterResX: number, filterResY: number): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - height: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGForeignObjectElement: { - prototype: SVGForeignObjectElement; - new(): SVGForeignObjectElement; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - spreadMethod: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_REPEAT: number; - SVG_SPREADMETHOD_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_REPEAT: number; - SVG_SPREADMETHOD_UNKNOWN: number; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - height: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGLength { - unitType: number; - value: number; - valueAsString: string; - valueInSpecifiedUnits: number; - convertToSpecifiedUnits(unitType: number): void; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_EXS: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; -} - -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_EXS: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; -} - -interface SVGLengthList { - numberOfItems: number; - appendItem(newItem: SVGLength): SVGLength; - clear(): void; - getItem(index: number): SVGLength; - initialize(newItem: SVGLength): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; - removeItem(index: number): SVGLength; - replaceItem(newItem: SVGLength, index: number): SVGLength; -} - -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - x1: SVGAnimatedLength; - x2: SVGAnimatedLength; - y1: SVGAnimatedLength; - y2: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - x1: SVGAnimatedLength; - x2: SVGAnimatedLength; - y1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} - -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - markerHeight: SVGAnimatedLength; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - orientType: SVGAnimatedEnumeration; - refX: SVGAnimatedLength; - refY: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKER_ORIENT_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKER_ORIENT_UNKNOWN: number; -} - -interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { - height: SVGAnimatedLength; - maskContentUnits: SVGAnimatedEnumeration; - maskUnits: SVGAnimatedEnumeration; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -interface SVGMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - flipX(): SVGMatrix; - flipY(): SVGMatrix; - inverse(): SVGMatrix; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - rotate(angle: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - skewX(angle: number): SVGMatrix; - skewY(angle: number): SVGMatrix; - translate(x: number, y: number): SVGMatrix; -} - -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface SVGMetadataElement extends SVGElement { -} - -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGNumber { - value: number; -} - -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGNumberList { - numberOfItems: number; - appendItem(newItem: SVGNumber): SVGNumber; - clear(): void; - getItem(index: number): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; - removeItem(index: number): SVGNumber; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; -} - -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - getTotalLength(): number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_ARC_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_MOVETO_REL: number; - PATHSEG_UNKNOWN: number; -} - -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - PATHSEG_ARC_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_MOVETO_REL: number; - PATHSEG_UNKNOWN: number; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - angle: number; - largeArcFlag: boolean; - r1: number; - r2: number; - sweepFlag: boolean; - x: number; - y: number; -} - -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} - -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - x: number; - x1: number; - x2: number; - y: number; - y1: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - x: number; - x2: number; - y: number; - y2: number; -} - -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - x: number; - x1: number; - y: number; - y1: number; -} - -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} - -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} - -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGPathSegList { - numberOfItems: number; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - clear(): void; - getItem(index: number): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; -} - -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - x: number; - y: number; -} - -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { - height: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - patternUnits: SVGAnimatedEnumeration; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGPoint { - x: number; - y: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} - -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface SVGPointList { - numberOfItems: number; - appendItem(newItem: SVGPoint): SVGPoint; - clear(): void; - getItem(index: number): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; - removeItem(index: number): SVGPoint; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; -} - -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_MEETORSLICE_MEET: number; - SVG_MEETORSLICE_SLICE: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_MEETORSLICE_MEET: number; - SVG_MEETORSLICE_SLICE: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; - r: SVGAnimatedLength; -} - -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface SVGRect { - height: number; - width: number; - x: number; - y: number; -} - -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - height: SVGAnimatedLength; - rx: SVGAnimatedLength; - ry: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - contentScriptType: string; - contentStyleType: string; - currentScale: number; - currentTranslate: SVGPoint; - height: SVGAnimatedLength; - onabort: (ev: Event) => any; - onerror: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onscroll: (ev: UIEvent) => any; - onunload: (ev: Event) => any; - onzoom: (ev: SVGZoomEvent) => any; - pixelUnitToMillimeterX: number; - pixelUnitToMillimeterY: number; - screenPixelToMillimeterX: number; - screenPixelToMillimeterY: number; - viewport: SVGRect; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - createSVGAngle(): SVGAngle; - createSVGLength(): SVGLength; - createSVGMatrix(): SVGMatrix; - createSVGNumber(): SVGNumber; - createSVGPoint(): SVGPoint; - createSVGRect(): SVGRect; - createSVGTransform(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - deselectAll(): void; - forceRedraw(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getCurrentTime(): number; - getElementById(elementId: string): Element; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - pauseAnimations(): void; - setCurrentTime(seconds: number): void; - suspendRedraw(maxWaitMilliseconds: number): number; - unpauseAnimations(): void; - unsuspendRedraw(suspendHandleID: number): void; - unsuspendRedrawAll(): void; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "SVGAbort", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGError", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGUnload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "SVGZoom", listener: (ev: SVGZoomEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface SVGStringList { - numberOfItems: number; - appendItem(newItem: string): string; - clear(): void; - getItem(index: number): string; - initialize(newItem: string): string; - insertItemBefore(newItem: string, index: number): string; - removeItem(index: number): string; - replaceItem(newItem: string, index: number): string; -} - -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - title: string; - type: string; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} - -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { - lengthAdjust: SVGAnimatedEnumeration; - textLength: SVGAnimatedLength; - getCharNumAtPosition(point: SVGPoint): number; - getComputedTextLength(): number; - getEndPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - startOffset: SVGAnimatedLength; - TEXTPATH_METHODTYPE_ALIGN: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_METHODTYPE_ALIGN: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - dx: SVGAnimatedLengthList; - dy: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - x: SVGAnimatedLengthList; - y: SVGAnimatedLengthList; -} - -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface SVGTransform { - angle: number; - matrix: SVGMatrix; - type: number; - setMatrix(matrix: SVGMatrix): void; - setRotate(angle: number, cx: number, cy: number): void; - setScale(sx: number, sy: number): void; - setSkewX(angle: number): void; - setSkewY(angle: number): void; - setTranslate(tx: number, ty: number): void; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_SKEWY: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_UNKNOWN: number; -} - -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_SKEWY: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_UNKNOWN: number; -} - -interface SVGTransformList { - numberOfItems: number; - appendItem(newItem: SVGTransform): SVGTransform; - clear(): void; - consolidate(): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getItem(index: number): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - removeItem(index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; -} - -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface SVGUnitTypes { - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { - animatedInstanceRoot: SVGElementInstance; - height: SVGAnimatedLength; - instanceRoot: SVGElementInstance; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { - viewTarget: SVGStringList; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface SVGZoomAndPan { - SVG_ZOOMANDPAN_DISABLE: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; -} -declare var SVGZoomAndPan: SVGZoomAndPan; - -interface SVGZoomEvent extends UIEvent { - newScale: number; - newTranslate: SVGPoint; - previousScale: number; - previousTranslate: SVGPoint; - zoomRectScreen: SVGRect; -} - -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface Screen extends EventTarget { - availHeight: number; - availWidth: number; - bufferDepth: number; - colorDepth: number; - deviceXDPI: number; - deviceYDPI: number; - fontSmoothingEnabled: boolean; - height: number; - logicalXDPI: number; - logicalYDPI: number; - msOrientation: string; - onmsorientationchange: (ev: Event) => any; - pixelDepth: number; - systemXDPI: number; - systemYDPI: number; - width: number; - msLockOrientation(orientations: string): boolean; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "MSOrientationChange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface ScriptNotifyEvent extends Event { - callingUri: string; - value: string; -} - -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; -} - -interface ScriptProcessorNode extends AudioNode { - bufferSize: number; - onaudioprocess: (ev: AudioProcessingEvent) => any; - addEventListener(type: "audioprocess", listener: (ev: AudioProcessingEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var ScriptProcessorNode: { - prototype: ScriptProcessorNode; - new(): ScriptProcessorNode; -} - -interface Selection { - anchorNode: Node; - anchorOffset: number; - focusNode: Node; - focusOffset: number; - isCollapsed: boolean; - rangeCount: number; - type: string; - addRange(range: Range): void; - collapse(parentNode: Node, offset: number): void; - collapseToEnd(): void; - collapseToStart(): void; - containsNode(node: Node, partlyContained: boolean): boolean; - deleteFromDocument(): void; - empty(): void; - extend(newNode: Node, offset: number): void; - getRangeAt(index: number): Range; - removeAllRanges(): void; - removeRange(range: Range): void; - selectAllChildren(parentNode: Node): void; - setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; - toString(): string; -} - -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SourceBuffer extends EventTarget { - appendWindowEnd: number; - appendWindowStart: number; - audioTracks: AudioTrackList; - buffered: TimeRanges; - mode: string; - timestampOffset: number; - updating: boolean; - videoTracks: VideoTrackList; - abort(): void; - appendBuffer(data: ArrayBuffer): void; - appendBuffer(data: ArrayBufferView): void; - appendStream(stream: MSStream, maxSize?: number): void; - remove(start: number, end: number): void; -} - -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; -} - -interface SourceBufferList extends EventTarget { - length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} - -declare var SourceBufferList: { - prototype: SourceBufferList; - new(): SourceBufferList; -} - -interface StereoPannerNode extends AudioNode { - pan: AudioParam; -} - -declare var StereoPannerNode: { - prototype: StereoPannerNode; - new(): StereoPannerNode; -} - -interface Storage { - length: number; - clear(): void; - getItem(key: string): any; - key(index: number): string; - removeItem(key: string): void; - setItem(key: string, data: string): void; - [key: string]: any; - [index: number]: string; -} - -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface StorageEvent extends Event { - key: string; - newValue: any; - oldValue: any; - storageArea: Storage; - url: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} - -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} - -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface StyleSheet { - disabled: boolean; - href: string; - media: MediaList; - ownerNode: Node; - parentStyleSheet: StyleSheet; - title: string; - type: string; -} - -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} - -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} - -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface SubtleCrypto { - decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; - decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; - deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; - deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; - deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; - deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; - deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; - deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; - digest(algorithm: string, data: ArrayBufferView): any; - digest(algorithm: Algorithm, data: ArrayBufferView): any; - encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; - encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; - exportKey(format: string, key: CryptoKey): any; - generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; - generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; - sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; - unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; - verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; - wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; - wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; -} - -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; -} - -interface Text extends CharacterData { - wholeText: string; - replaceWholeText(content: string): Text; - splitText(offset: number): Text; -} - -declare var Text: { - prototype: Text; - new(): Text; -} - -interface TextEvent extends UIEvent { - data: string; - inputMethod: number; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_MULTIMODAL: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_VOICE: number; -} - -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_MULTIMODAL: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_VOICE: number; -} - -interface TextMetrics { - width: number; -} - -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface TextRange { - boundingHeight: number; - boundingLeft: number; - boundingTop: number; - boundingWidth: number; - htmlText: string; - offsetLeft: number; - offsetTop: number; - text: string; - collapse(start?: boolean): void; - compareEndPoints(how: string, sourceRange: TextRange): number; - duplicate(): TextRange; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - execCommandShowHelp(cmdID: string): boolean; - expand(Unit: string): boolean; - findText(string: string, count?: number, flags?: number): boolean; - getBookmark(): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; - inRange(range: TextRange): boolean; - isEqual(range: TextRange): boolean; - move(unit: string, count?: number): number; - moveEnd(unit: string, count?: number): number; - moveStart(unit: string, count?: number): number; - moveToBookmark(bookmark: string): boolean; - moveToElementText(element: Element): void; - moveToPoint(x: number, y: number): void; - parentElement(): Element; - pasteHTML(html: string): void; - queryCommandEnabled(cmdID: string): boolean; - queryCommandIndeterm(cmdID: string): boolean; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - queryCommandValue(cmdID: string): any; - scrollIntoView(fStart?: boolean): void; - select(): void; - setEndPoint(how: string, SourceRange: TextRange): void; -} - -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} - -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface TextTrack extends EventTarget { - activeCues: TextTrackCueList; - cues: TextTrackCueList; - inBandMetadataTrackDispatchType: string; - kind: string; - label: string; - language: string; - mode: any; - oncuechange: (ev: Event) => any; - onerror: (ev: Event) => any; - onload: (ev: Event) => any; - readyState: number; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - DISABLED: number; - ERROR: number; - HIDDEN: number; - LOADED: number; - LOADING: number; - NONE: number; - SHOWING: number; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - DISABLED: number; - ERROR: number; - HIDDEN: number; - LOADED: number; - LOADING: number; - NONE: number; - SHOWING: number; -} - -interface TextTrackCue extends EventTarget { - endTime: number; - id: string; - onenter: (ev: Event) => any; - onexit: (ev: Event) => any; - pauseOnExit: boolean; - startTime: number; - text: string; - track: TextTrack; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; -} - -interface TextTrackCueList { - length: number; - getCueById(id: string): TextTrackCue; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; -} - -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface TextTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - item(index: number): TextTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: TextTrack; -} - -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface TimeRanges { - length: number; - end(index: number): number; - start(index: number): number; -} - -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface Touch { - clientX: number; - clientY: number; - identifier: number; - pageX: number; - pageY: number; - screenX: number; - screenY: number; - target: EventTarget; -} - -declare var Touch: { - prototype: Touch; - new(): Touch; -} - -interface TouchEvent extends UIEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; -} - -declare var TouchEvent: { - prototype: TouchEvent; - new(): TouchEvent; -} - -interface TouchList { - length: number; - item(index: number): Touch; - [index: number]: Touch; -} - -declare var TouchList: { - prototype: TouchList; - new(): TouchList; -} - -interface TrackEvent extends Event { - track: any; -} - -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface TransitionEvent extends Event { - elapsedTime: number; - propertyName: string; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} - -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface TreeWalker { - currentNode: Node; - expandEntityReferences: boolean; - filter: NodeFilter; - root: Node; - whatToShow: number; - firstChild(): Node; - lastChild(): Node; - nextNode(): Node; - nextSibling(): Node; - parentNode(): Node; - previousNode(): Node; - previousSibling(): Node; -} - -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} - -declare var UIEvent: { - prototype: UIEvent; - new(type: string, eventInitDict?: UIEventInit): UIEvent; -} - -interface URL { - createObjectURL(object: any, options?: ObjectURLOptions): string; - revokeObjectURL(url: string): void; -} -declare var URL: URL; - -interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { - mediaType: string; -} - -declare var UnviewableContentIdentifiedEvent: { - prototype: UnviewableContentIdentifiedEvent; - new(): UnviewableContentIdentifiedEvent; -} - -interface ValidityState { - badInput: boolean; - customError: boolean; - patternMismatch: boolean; - rangeOverflow: boolean; - rangeUnderflow: boolean; - stepMismatch: boolean; - tooLong: boolean; - typeMismatch: boolean; - valid: boolean; - valueMissing: boolean; -} - -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface VideoPlaybackQuality { - corruptedVideoFrames: number; - creationTime: number; - droppedVideoFrames: number; - totalFrameDelay: number; - totalVideoFrames: number; -} - -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; -} - -interface VideoTrack { - id: string; - kind: string; - label: string; - language: string; - selected: boolean; - sourceBuffer: SourceBuffer; -} - -declare var VideoTrack: { - prototype: VideoTrack; - new(): VideoTrack; -} - -interface VideoTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - onchange: (ev: Event) => any; - onremovetrack: (ev: TrackEvent) => any; - selectedIndex: number; - getTrackById(id: string): VideoTrack; - item(index: number): VideoTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: VideoTrack; -} - -declare var VideoTrackList: { - prototype: VideoTrackList; - new(): VideoTrackList; -} - -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WEBGL_debug_renderer_info { - UNMASKED_RENDERER_WEBGL: number; - UNMASKED_VENDOR_WEBGL: number; -} - -declare var WEBGL_debug_renderer_info: { - prototype: WEBGL_debug_renderer_info; - new(): WEBGL_debug_renderer_info; - UNMASKED_RENDERER_WEBGL: number; - UNMASKED_VENDOR_WEBGL: number; -} - -interface WEBGL_depth_texture { - UNSIGNED_INT_24_8_WEBGL: number; -} - -declare var WEBGL_depth_texture: { - prototype: WEBGL_depth_texture; - new(): WEBGL_depth_texture; - UNSIGNED_INT_24_8_WEBGL: number; -} - -interface WaveShaperNode extends AudioNode { - curve: any; - oversample: string; -} - -declare var WaveShaperNode: { - prototype: WaveShaperNode; - new(): WaveShaperNode; -} - -interface WebGLActiveInfo { - name: string; - size: number; - type: number; -} - -declare var WebGLActiveInfo: { - prototype: WebGLActiveInfo; - new(): WebGLActiveInfo; -} - -interface WebGLBuffer extends WebGLObject { -} - -declare var WebGLBuffer: { - prototype: WebGLBuffer; - new(): WebGLBuffer; -} - -interface WebGLContextEvent extends Event { - statusMessage: string; -} - -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(): WebGLContextEvent; -} - -interface WebGLFramebuffer extends WebGLObject { -} - -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLObject { -} - -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - -interface WebGLProgram extends WebGLObject { -} - -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface WebGLRenderbuffer extends WebGLObject { -} - -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; -} - -interface WebGLRenderingContext { - canvas: HTMLCanvasElement; - drawingBufferHeight: number; - drawingBufferWidth: number; - activeTexture(texture: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - bindTexture(target: number, texture: WebGLTexture): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - blendEquation(mode: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - blendFunc(sfactor: number, dfactor: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - bufferData(target: number, size: number, usage: number): void; - bufferData(target: number, size: ArrayBufferView, usage: number): void; - bufferData(target: number, size: any, usage: number): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - bufferSubData(target: number, offset: number, data: any): void; - checkFramebufferStatus(target: number): number; - clear(mask: number): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - clearDepth(depth: number): void; - clearStencil(s: number): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compileShader(shader: WebGLShader): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - createBuffer(): WebGLBuffer; - createFramebuffer(): WebGLFramebuffer; - createProgram(): WebGLProgram; - createRenderbuffer(): WebGLRenderbuffer; - createShader(type: number): WebGLShader; - createTexture(): WebGLTexture; - cullFace(mode: number): void; - deleteBuffer(buffer: WebGLBuffer): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - deleteProgram(program: WebGLProgram): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - deleteShader(shader: WebGLShader): void; - deleteTexture(texture: WebGLTexture): void; - depthFunc(func: number): void; - depthMask(flag: boolean): void; - depthRange(zNear: number, zFar: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - disable(cap: number): void; - disableVertexAttribArray(index: number): void; - drawArrays(mode: number, first: number, count: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - enable(cap: number): void; - enableVertexAttribArray(index: number): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - frontFace(mode: number): void; - generateMipmap(target: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - getAttribLocation(program: WebGLProgram, name: string): number; - getBufferParameter(target: number, pname: number): any; - getContextAttributes(): WebGLContextAttributes; - getError(): number; - getExtension(name: string): any; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - getParameter(pname: number): any; - getProgramInfoLog(program: WebGLProgram): string; - getProgramParameter(program: WebGLProgram, pname: number): any; - getRenderbufferParameter(target: number, pname: number): any; - getShaderInfoLog(shader: WebGLShader): string; - getShaderParameter(shader: WebGLShader, pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getShaderSource(shader: WebGLShader): string; - getSupportedExtensions(): string[]; - getTexParameter(target: number, pname: number): any; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - getVertexAttrib(index: number, pname: number): any; - getVertexAttribOffset(index: number, pname: number): number; - hint(target: number, mode: number): void; - isBuffer(buffer: WebGLBuffer): boolean; - isContextLost(): boolean; - isEnabled(cap: number): boolean; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - isProgram(program: WebGLProgram): boolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - isShader(shader: WebGLShader): boolean; - isTexture(texture: WebGLTexture): boolean; - lineWidth(width: number): void; - linkProgram(program: WebGLProgram): void; - pixelStorei(pname: number, param: number): void; - polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - sampleCoverage(value: number, invert: boolean): void; - scissor(x: number, y: number, width: number, height: number): void; - shaderSource(shader: WebGLShader, source: string): void; - stencilFunc(func: number, ref: number, mask: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - stencilMask(mask: number): void; - 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, format: number, type: number, pixels: ImageData): 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, format: number, type: number, pixels: ImageData): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: any): void; - uniform1i(location: WebGLUniformLocation, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: any): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: any): void; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: any): void; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; - useProgram(program: WebGLProgram): void; - validateProgram(program: WebGLProgram): void; - vertexAttrib1f(indx: number, x: number): void; - vertexAttrib1fv(indx: number, values: any): void; - vertexAttrib2f(indx: number, x: number, y: number): void; - vertexAttrib2fv(indx: number, values: any): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - vertexAttrib3fv(indx: number, values: any): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - vertexAttrib4fv(indx: number, values: any): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - viewport(x: number, y: number, width: number, height: number): void; - ACTIVE_ATTRIBUTES: number; - ACTIVE_TEXTURE: number; - ACTIVE_UNIFORMS: number; - ALIASED_LINE_WIDTH_RANGE: number; - ALIASED_POINT_SIZE_RANGE: number; - ALPHA: number; - ALPHA_BITS: number; - ALWAYS: number; - ARRAY_BUFFER: number; - ARRAY_BUFFER_BINDING: number; - ATTACHED_SHADERS: number; - BACK: number; - BLEND: number; - BLEND_COLOR: number; - BLEND_DST_ALPHA: number; - BLEND_DST_RGB: number; - BLEND_EQUATION: number; - BLEND_EQUATION_ALPHA: number; - BLEND_EQUATION_RGB: number; - BLEND_SRC_ALPHA: number; - BLEND_SRC_RGB: number; - BLUE_BITS: number; - BOOL: number; - BOOL_VEC2: number; - BOOL_VEC3: number; - BOOL_VEC4: number; - BROWSER_DEFAULT_WEBGL: number; - BUFFER_SIZE: number; - BUFFER_USAGE: number; - BYTE: number; - CCW: number; - CLAMP_TO_EDGE: number; - COLOR_ATTACHMENT0: number; - COLOR_BUFFER_BIT: number; - COLOR_CLEAR_VALUE: number; - COLOR_WRITEMASK: number; - COMPILE_STATUS: number; - COMPRESSED_TEXTURE_FORMATS: number; - CONSTANT_ALPHA: number; - CONSTANT_COLOR: number; - CONTEXT_LOST_WEBGL: number; - CULL_FACE: number; - CULL_FACE_MODE: number; - CURRENT_PROGRAM: number; - CURRENT_VERTEX_ATTRIB: number; - CW: number; - DECR: number; - DECR_WRAP: number; - DELETE_STATUS: number; - DEPTH_ATTACHMENT: number; - DEPTH_BITS: number; - DEPTH_BUFFER_BIT: number; - DEPTH_CLEAR_VALUE: number; - DEPTH_COMPONENT: number; - DEPTH_COMPONENT16: number; - DEPTH_FUNC: number; - DEPTH_RANGE: number; - DEPTH_STENCIL: number; - DEPTH_STENCIL_ATTACHMENT: number; - DEPTH_TEST: number; - DEPTH_WRITEMASK: number; - DITHER: number; - DONT_CARE: number; - DST_ALPHA: number; - DST_COLOR: number; - DYNAMIC_DRAW: number; - ELEMENT_ARRAY_BUFFER: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - EQUAL: number; - FASTEST: number; - FLOAT: number; - FLOAT_MAT2: number; - FLOAT_MAT3: number; - FLOAT_MAT4: number; - FLOAT_VEC2: number; - FLOAT_VEC3: number; - FLOAT_VEC4: number; - FRAGMENT_SHADER: number; - FRAMEBUFFER: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - FRAMEBUFFER_BINDING: number; - FRAMEBUFFER_COMPLETE: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - FRAMEBUFFER_UNSUPPORTED: number; - FRONT: number; - FRONT_AND_BACK: number; - FRONT_FACE: number; - FUNC_ADD: number; - FUNC_REVERSE_SUBTRACT: number; - FUNC_SUBTRACT: number; - GENERATE_MIPMAP_HINT: number; - GEQUAL: number; - GREATER: number; - GREEN_BITS: number; - HIGH_FLOAT: number; - HIGH_INT: number; - IMPLEMENTATION_COLOR_READ_FORMAT: number; - IMPLEMENTATION_COLOR_READ_TYPE: number; - INCR: number; - INCR_WRAP: number; - INT: number; - INT_VEC2: number; - INT_VEC3: number; - INT_VEC4: number; - INVALID_ENUM: number; - INVALID_FRAMEBUFFER_OPERATION: number; - INVALID_OPERATION: number; - INVALID_VALUE: number; - INVERT: number; - KEEP: number; - LEQUAL: number; - LESS: number; - LINEAR: number; - LINEAR_MIPMAP_LINEAR: number; - LINEAR_MIPMAP_NEAREST: number; - LINES: number; - LINE_LOOP: number; - LINE_STRIP: number; - LINE_WIDTH: number; - LINK_STATUS: number; - LOW_FLOAT: number; - LOW_INT: number; - LUMINANCE: number; - LUMINANCE_ALPHA: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - MAX_RENDERBUFFER_SIZE: number; - MAX_TEXTURE_IMAGE_UNITS: number; - MAX_TEXTURE_SIZE: number; - MAX_VARYING_VECTORS: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - MAX_VIEWPORT_DIMS: number; - MEDIUM_FLOAT: number; - MEDIUM_INT: number; - MIRRORED_REPEAT: number; - NEAREST: number; - NEAREST_MIPMAP_LINEAR: number; - NEAREST_MIPMAP_NEAREST: number; - NEVER: number; - NICEST: number; - NONE: number; - NOTEQUAL: number; - NO_ERROR: number; - ONE: number; - ONE_MINUS_CONSTANT_ALPHA: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_DST_ALPHA: number; - ONE_MINUS_DST_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - ONE_MINUS_SRC_COLOR: number; - OUT_OF_MEMORY: number; - PACK_ALIGNMENT: number; - POINTS: number; - POLYGON_OFFSET_FACTOR: number; - POLYGON_OFFSET_FILL: number; - POLYGON_OFFSET_UNITS: number; - RED_BITS: number; - RENDERBUFFER: number; - RENDERBUFFER_ALPHA_SIZE: number; - RENDERBUFFER_BINDING: number; - RENDERBUFFER_BLUE_SIZE: number; - RENDERBUFFER_DEPTH_SIZE: number; - RENDERBUFFER_GREEN_SIZE: number; - RENDERBUFFER_HEIGHT: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - RENDERBUFFER_RED_SIZE: number; - RENDERBUFFER_STENCIL_SIZE: number; - RENDERBUFFER_WIDTH: number; - RENDERER: number; - REPEAT: number; - REPLACE: number; - RGB: number; - RGB565: number; - RGB5_A1: number; - RGBA: number; - RGBA4: number; - SAMPLER_2D: number; - SAMPLER_CUBE: number; - SAMPLES: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - SAMPLE_BUFFERS: number; - SAMPLE_COVERAGE: number; - SAMPLE_COVERAGE_INVERT: number; - SAMPLE_COVERAGE_VALUE: number; - SCISSOR_BOX: number; - SCISSOR_TEST: number; - SHADER_TYPE: number; - SHADING_LANGUAGE_VERSION: number; - SHORT: number; - SRC_ALPHA: number; - SRC_ALPHA_SATURATE: number; - SRC_COLOR: number; - STATIC_DRAW: number; - STENCIL_ATTACHMENT: number; - STENCIL_BACK_FAIL: number; - STENCIL_BACK_FUNC: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - STENCIL_BACK_REF: number; - STENCIL_BACK_VALUE_MASK: number; - STENCIL_BACK_WRITEMASK: number; - STENCIL_BITS: number; - STENCIL_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - STENCIL_FAIL: number; - STENCIL_FUNC: number; - STENCIL_INDEX: number; - STENCIL_INDEX8: number; - STENCIL_PASS_DEPTH_FAIL: number; - STENCIL_PASS_DEPTH_PASS: number; - STENCIL_REF: number; - STENCIL_TEST: number; - STENCIL_VALUE_MASK: number; - STENCIL_WRITEMASK: number; - STREAM_DRAW: number; - SUBPIXEL_BITS: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE1: number; - TEXTURE10: number; - TEXTURE11: number; - TEXTURE12: number; - TEXTURE13: number; - TEXTURE14: number; - TEXTURE15: number; - TEXTURE16: number; - TEXTURE17: number; - TEXTURE18: number; - TEXTURE19: number; - TEXTURE2: number; - TEXTURE20: number; - TEXTURE21: number; - TEXTURE22: number; - TEXTURE23: number; - TEXTURE24: number; - TEXTURE25: number; - TEXTURE26: number; - TEXTURE27: number; - TEXTURE28: number; - TEXTURE29: number; - TEXTURE3: number; - TEXTURE30: number; - TEXTURE31: number; - TEXTURE4: number; - TEXTURE5: number; - TEXTURE6: number; - TEXTURE7: number; - TEXTURE8: number; - TEXTURE9: number; - TEXTURE_2D: number; - TEXTURE_BINDING_2D: number; - TEXTURE_BINDING_CUBE_MAP: number; - TEXTURE_CUBE_MAP: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - TEXTURE_MAG_FILTER: number; - TEXTURE_MIN_FILTER: number; - TEXTURE_WRAP_S: number; - TEXTURE_WRAP_T: number; - TRIANGLES: number; - TRIANGLE_FAN: number; - TRIANGLE_STRIP: number; - UNPACK_ALIGNMENT: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - UNPACK_FLIP_Y_WEBGL: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - UNSIGNED_BYTE: number; - UNSIGNED_INT: number; - UNSIGNED_SHORT: number; - UNSIGNED_SHORT_4_4_4_4: number; - UNSIGNED_SHORT_5_5_5_1: number; - UNSIGNED_SHORT_5_6_5: number; - VALIDATE_STATUS: number; - VENDOR: number; - VERSION: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - VERTEX_SHADER: number; - VIEWPORT: number; - ZERO: number; -} - -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - ACTIVE_ATTRIBUTES: number; - ACTIVE_TEXTURE: number; - ACTIVE_UNIFORMS: number; - ALIASED_LINE_WIDTH_RANGE: number; - ALIASED_POINT_SIZE_RANGE: number; - ALPHA: number; - ALPHA_BITS: number; - ALWAYS: number; - ARRAY_BUFFER: number; - ARRAY_BUFFER_BINDING: number; - ATTACHED_SHADERS: number; - BACK: number; - BLEND: number; - BLEND_COLOR: number; - BLEND_DST_ALPHA: number; - BLEND_DST_RGB: number; - BLEND_EQUATION: number; - BLEND_EQUATION_ALPHA: number; - BLEND_EQUATION_RGB: number; - BLEND_SRC_ALPHA: number; - BLEND_SRC_RGB: number; - BLUE_BITS: number; - BOOL: number; - BOOL_VEC2: number; - BOOL_VEC3: number; - BOOL_VEC4: number; - BROWSER_DEFAULT_WEBGL: number; - BUFFER_SIZE: number; - BUFFER_USAGE: number; - BYTE: number; - CCW: number; - CLAMP_TO_EDGE: number; - COLOR_ATTACHMENT0: number; - COLOR_BUFFER_BIT: number; - COLOR_CLEAR_VALUE: number; - COLOR_WRITEMASK: number; - COMPILE_STATUS: number; - COMPRESSED_TEXTURE_FORMATS: number; - CONSTANT_ALPHA: number; - CONSTANT_COLOR: number; - CONTEXT_LOST_WEBGL: number; - CULL_FACE: number; - CULL_FACE_MODE: number; - CURRENT_PROGRAM: number; - CURRENT_VERTEX_ATTRIB: number; - CW: number; - DECR: number; - DECR_WRAP: number; - DELETE_STATUS: number; - DEPTH_ATTACHMENT: number; - DEPTH_BITS: number; - DEPTH_BUFFER_BIT: number; - DEPTH_CLEAR_VALUE: number; - DEPTH_COMPONENT: number; - DEPTH_COMPONENT16: number; - DEPTH_FUNC: number; - DEPTH_RANGE: number; - DEPTH_STENCIL: number; - DEPTH_STENCIL_ATTACHMENT: number; - DEPTH_TEST: number; - DEPTH_WRITEMASK: number; - DITHER: number; - DONT_CARE: number; - DST_ALPHA: number; - DST_COLOR: number; - DYNAMIC_DRAW: number; - ELEMENT_ARRAY_BUFFER: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - EQUAL: number; - FASTEST: number; - FLOAT: number; - FLOAT_MAT2: number; - FLOAT_MAT3: number; - FLOAT_MAT4: number; - FLOAT_VEC2: number; - FLOAT_VEC3: number; - FLOAT_VEC4: number; - FRAGMENT_SHADER: number; - FRAMEBUFFER: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - FRAMEBUFFER_BINDING: number; - FRAMEBUFFER_COMPLETE: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - FRAMEBUFFER_UNSUPPORTED: number; - FRONT: number; - FRONT_AND_BACK: number; - FRONT_FACE: number; - FUNC_ADD: number; - FUNC_REVERSE_SUBTRACT: number; - FUNC_SUBTRACT: number; - GENERATE_MIPMAP_HINT: number; - GEQUAL: number; - GREATER: number; - GREEN_BITS: number; - HIGH_FLOAT: number; - HIGH_INT: number; - IMPLEMENTATION_COLOR_READ_FORMAT: number; - IMPLEMENTATION_COLOR_READ_TYPE: number; - INCR: number; - INCR_WRAP: number; - INT: number; - INT_VEC2: number; - INT_VEC3: number; - INT_VEC4: number; - INVALID_ENUM: number; - INVALID_FRAMEBUFFER_OPERATION: number; - INVALID_OPERATION: number; - INVALID_VALUE: number; - INVERT: number; - KEEP: number; - LEQUAL: number; - LESS: number; - LINEAR: number; - LINEAR_MIPMAP_LINEAR: number; - LINEAR_MIPMAP_NEAREST: number; - LINES: number; - LINE_LOOP: number; - LINE_STRIP: number; - LINE_WIDTH: number; - LINK_STATUS: number; - LOW_FLOAT: number; - LOW_INT: number; - LUMINANCE: number; - LUMINANCE_ALPHA: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - MAX_RENDERBUFFER_SIZE: number; - MAX_TEXTURE_IMAGE_UNITS: number; - MAX_TEXTURE_SIZE: number; - MAX_VARYING_VECTORS: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - MAX_VIEWPORT_DIMS: number; - MEDIUM_FLOAT: number; - MEDIUM_INT: number; - MIRRORED_REPEAT: number; - NEAREST: number; - NEAREST_MIPMAP_LINEAR: number; - NEAREST_MIPMAP_NEAREST: number; - NEVER: number; - NICEST: number; - NONE: number; - NOTEQUAL: number; - NO_ERROR: number; - ONE: number; - ONE_MINUS_CONSTANT_ALPHA: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_DST_ALPHA: number; - ONE_MINUS_DST_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - ONE_MINUS_SRC_COLOR: number; - OUT_OF_MEMORY: number; - PACK_ALIGNMENT: number; - POINTS: number; - POLYGON_OFFSET_FACTOR: number; - POLYGON_OFFSET_FILL: number; - POLYGON_OFFSET_UNITS: number; - RED_BITS: number; - RENDERBUFFER: number; - RENDERBUFFER_ALPHA_SIZE: number; - RENDERBUFFER_BINDING: number; - RENDERBUFFER_BLUE_SIZE: number; - RENDERBUFFER_DEPTH_SIZE: number; - RENDERBUFFER_GREEN_SIZE: number; - RENDERBUFFER_HEIGHT: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - RENDERBUFFER_RED_SIZE: number; - RENDERBUFFER_STENCIL_SIZE: number; - RENDERBUFFER_WIDTH: number; - RENDERER: number; - REPEAT: number; - REPLACE: number; - RGB: number; - RGB565: number; - RGB5_A1: number; - RGBA: number; - RGBA4: number; - SAMPLER_2D: number; - SAMPLER_CUBE: number; - SAMPLES: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - SAMPLE_BUFFERS: number; - SAMPLE_COVERAGE: number; - SAMPLE_COVERAGE_INVERT: number; - SAMPLE_COVERAGE_VALUE: number; - SCISSOR_BOX: number; - SCISSOR_TEST: number; - SHADER_TYPE: number; - SHADING_LANGUAGE_VERSION: number; - SHORT: number; - SRC_ALPHA: number; - SRC_ALPHA_SATURATE: number; - SRC_COLOR: number; - STATIC_DRAW: number; - STENCIL_ATTACHMENT: number; - STENCIL_BACK_FAIL: number; - STENCIL_BACK_FUNC: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - STENCIL_BACK_REF: number; - STENCIL_BACK_VALUE_MASK: number; - STENCIL_BACK_WRITEMASK: number; - STENCIL_BITS: number; - STENCIL_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - STENCIL_FAIL: number; - STENCIL_FUNC: number; - STENCIL_INDEX: number; - STENCIL_INDEX8: number; - STENCIL_PASS_DEPTH_FAIL: number; - STENCIL_PASS_DEPTH_PASS: number; - STENCIL_REF: number; - STENCIL_TEST: number; - STENCIL_VALUE_MASK: number; - STENCIL_WRITEMASK: number; - STREAM_DRAW: number; - SUBPIXEL_BITS: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE1: number; - TEXTURE10: number; - TEXTURE11: number; - TEXTURE12: number; - TEXTURE13: number; - TEXTURE14: number; - TEXTURE15: number; - TEXTURE16: number; - TEXTURE17: number; - TEXTURE18: number; - TEXTURE19: number; - TEXTURE2: number; - TEXTURE20: number; - TEXTURE21: number; - TEXTURE22: number; - TEXTURE23: number; - TEXTURE24: number; - TEXTURE25: number; - TEXTURE26: number; - TEXTURE27: number; - TEXTURE28: number; - TEXTURE29: number; - TEXTURE3: number; - TEXTURE30: number; - TEXTURE31: number; - TEXTURE4: number; - TEXTURE5: number; - TEXTURE6: number; - TEXTURE7: number; - TEXTURE8: number; - TEXTURE9: number; - TEXTURE_2D: number; - TEXTURE_BINDING_2D: number; - TEXTURE_BINDING_CUBE_MAP: number; - TEXTURE_CUBE_MAP: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - TEXTURE_MAG_FILTER: number; - TEXTURE_MIN_FILTER: number; - TEXTURE_WRAP_S: number; - TEXTURE_WRAP_T: number; - TRIANGLES: number; - TRIANGLE_FAN: number; - TRIANGLE_STRIP: number; - UNPACK_ALIGNMENT: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - UNPACK_FLIP_Y_WEBGL: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - UNSIGNED_BYTE: number; - UNSIGNED_INT: number; - UNSIGNED_SHORT: number; - UNSIGNED_SHORT_4_4_4_4: number; - UNSIGNED_SHORT_5_5_5_1: number; - UNSIGNED_SHORT_5_6_5: number; - VALIDATE_STATUS: number; - VENDOR: number; - VERSION: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - VERTEX_SHADER: number; - VIEWPORT: number; - ZERO: number; -} - -interface WebGLShader extends WebGLObject { -} - -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface WebGLShaderPrecisionFormat { - precision: number; - rangeMax: number; - rangeMin: number; -} - -declare var WebGLShaderPrecisionFormat: { - prototype: WebGLShaderPrecisionFormat; - new(): WebGLShaderPrecisionFormat; -} - -interface WebGLTexture extends WebGLObject { -} - -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; -} - -interface WebGLUniformLocation { -} - -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; -} - -interface WebKitCSSMatrix { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - inverse(): WebKitCSSMatrix; - multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; - rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; - setMatrixValue(value: string): void; - skewX(angle: number): WebKitCSSMatrix; - skewY(angle: number): WebKitCSSMatrix; - toString(): string; - translate(x: number, y: number, z?: number): WebKitCSSMatrix; -} - -declare var WebKitCSSMatrix: { - prototype: WebKitCSSMatrix; - new(text?: string): WebKitCSSMatrix; -} - -interface WebKitPoint { - x: number; - y: number; -} - -declare var WebKitPoint: { - prototype: WebKitPoint; - new(x?: number, y?: number): WebKitPoint; -} - -interface WebSocket extends EventTarget { - binaryType: string; - bufferedAmount: number; - extensions: string; - onclose: (ev: CloseEvent) => any; - onerror: (ev: Event) => any; - onmessage: (ev: MessageEvent) => any; - onopen: (ev: Event) => any; - protocol: string; - readyState: number; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - CLOSED: number; - CLOSING: number; - CONNECTING: number; - OPEN: number; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: any): WebSocket; - CLOSED: number; - CLOSING: number; - CONNECTING: number; - OPEN: number; -} - -interface WheelEvent extends MouseEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - getCurrentPoint(element: Element): void; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; - DOM_DELTA_PIXEL: number; -} - -declare var WheelEvent: { - prototype: WheelEvent; - new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; - DOM_DELTA_PIXEL: number; -} - -interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { - animationStartTime: number; - applicationCache: ApplicationCache; - clientInformation: Navigator; - closed: boolean; - crypto: Crypto; - defaultStatus: string; - devicePixelRatio: number; - doNotTrack: string; - document: Document; - event: Event; - external: External; - frameElement: Element; - frames: Window; - history: History; - innerHeight: number; - innerWidth: number; - length: number; - location: Location; - locationbar: BarProp; - menubar: BarProp; - msAnimationStartTime: number; - msTemplatePrinter: MSTemplatePrinter; - name: string; - navigator: Navigator; - offscreenBuffering: string | boolean; - onabort: (ev: Event) => any; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onblur: (ev: FocusEvent) => any; - oncanplay: (ev: Event) => any; - oncanplaythrough: (ev: Event) => any; - onchange: (ev: Event) => any; - onclick: (ev: MouseEvent) => any; - oncompassneedscalibration: (ev: Event) => any; - oncontextmenu: (ev: PointerEvent) => any; - ondblclick: (ev: MouseEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - ondrag: (ev: DragEvent) => any; - ondragend: (ev: DragEvent) => any; - ondragenter: (ev: DragEvent) => any; - ondragleave: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrop: (ev: DragEvent) => any; - ondurationchange: (ev: Event) => any; - onemptied: (ev: Event) => any; - onended: (ev: Event) => any; - onerror: ErrorEventHandler; - onfocus: (ev: FocusEvent) => any; - onhashchange: (ev: HashChangeEvent) => any; - oninput: (ev: Event) => any; - onkeydown: (ev: KeyboardEvent) => any; - onkeypress: (ev: KeyboardEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onload: (ev: Event) => any; - onloadeddata: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onloadstart: (ev: Event) => any; - onmessage: (ev: MessageEvent) => any; - onmousedown: (ev: MouseEvent) => any; - onmouseenter: (ev: MouseEvent) => any; - onmouseleave: (ev: MouseEvent) => any; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onmouseover: (ev: MouseEvent) => any; - onmouseup: (ev: MouseEvent) => any; - onmousewheel: (ev: MouseWheelEvent) => any; - onmsgesturechange: (ev: MSGestureEvent) => any; - onmsgesturedoubletap: (ev: MSGestureEvent) => any; - onmsgestureend: (ev: MSGestureEvent) => any; - onmsgesturehold: (ev: MSGestureEvent) => any; - onmsgesturestart: (ev: MSGestureEvent) => any; - onmsgesturetap: (ev: MSGestureEvent) => any; - onmsinertiastart: (ev: MSGestureEvent) => any; - onmspointercancel: (ev: MSPointerEvent) => any; - onmspointerdown: (ev: MSPointerEvent) => any; - onmspointerenter: (ev: MSPointerEvent) => any; - onmspointerleave: (ev: MSPointerEvent) => any; - onmspointermove: (ev: MSPointerEvent) => any; - onmspointerout: (ev: MSPointerEvent) => any; - onmspointerover: (ev: MSPointerEvent) => any; - onmspointerup: (ev: MSPointerEvent) => any; - onoffline: (ev: Event) => any; - ononline: (ev: Event) => any; - onorientationchange: (ev: Event) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpause: (ev: Event) => any; - onplay: (ev: Event) => any; - onplaying: (ev: Event) => any; - onpopstate: (ev: PopStateEvent) => any; - onprogress: (ev: ProgressEvent) => any; - onratechange: (ev: Event) => any; - onreadystatechange: (ev: ProgressEvent) => any; - onreset: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onscroll: (ev: UIEvent) => any; - onseeked: (ev: Event) => any; - onseeking: (ev: Event) => any; - onselect: (ev: UIEvent) => any; - onstalled: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onsubmit: (ev: Event) => any; - onsuspend: (ev: Event) => any; - ontimeupdate: (ev: Event) => any; - ontouchcancel: any; - ontouchend: any; - ontouchmove: any; - ontouchstart: any; - onunload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - onwaiting: (ev: Event) => any; - opener: Window; - orientation: string; - outerHeight: number; - outerWidth: number; - pageXOffset: number; - pageYOffset: number; - parent: Window; - performance: Performance; - personalbar: BarProp; - screen: Screen; - screenLeft: number; - screenTop: number; - screenX: number; - screenY: number; - scrollX: number; - scrollY: number; - scrollbars: BarProp; - self: Window; - status: string; - statusbar: BarProp; - styleMedia: StyleMedia; - toolbar: BarProp; - top: Window; - window: Window; - alert(message?: any): void; - blur(): void; - cancelAnimationFrame(handle: number): void; - captureEvents(): void; - close(): void; - confirm(message?: string): boolean; - focus(): void; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; - getSelection(): Selection; - matchMedia(mediaQuery: string): MediaQueryList; - moveBy(x?: number, y?: number): void; - moveTo(x?: number, y?: number): void; - msCancelRequestAnimationFrame(handle: number): void; - msMatchMedia(mediaQuery: string): MediaQueryList; - msRequestAnimationFrame(callback: FrameRequestCallback): number; - msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): any; - postMessage(message: any, targetOrigin: string, ports?: any): void; - print(): void; - prompt(message?: string, _default?: string): string; - releaseEvents(): void; - requestAnimationFrame(callback: FrameRequestCallback): number; - resizeBy(x?: number, y?: number): void; - resizeTo(x?: number, y?: number): void; - scroll(x?: number, y?: number): void; - scrollBy(x?: number, y?: number): void; - scrollTo(x?: number, y?: number): void; - webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; - webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; - 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; - addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - [index: number]: Window; -} - -declare var Window: { - prototype: Window; - new(): Window; -} - -interface Worker extends EventTarget, AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface XMLDocument extends Document { -} - -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; -} - -interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { - msCaching: string; - onreadystatechange: (ev: ProgressEvent) => any; - readyState: number; - response: any; - responseBody: any; - responseText: string; - responseType: string; - responseXML: any; - status: number; - statusText: string; - timeout: number; - upload: XMLHttpRequestUpload; - withCredentials: boolean; - abort(): void; - getAllResponseHeaders(): string; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - overrideMimeType(mime: string): void; - send(data?: Document): void; - send(data?: string): void; - send(data?: any): void; - setRequestHeader(header: string, value: string): void; - DONE: number; - HEADERS_RECEIVED: number; - LOADING: number; - OPENED: number; - UNSENT: number; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - DONE: number; - HEADERS_RECEIVED: number; - LOADING: number; - OPENED: number; - UNSENT: number; - create(): XMLHttpRequest; -} - -interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -declare var XMLHttpRequestUpload: { - prototype: XMLHttpRequestUpload; - new(): XMLHttpRequestUpload; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} - -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface XPathEvaluator { - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver?: Node): XPathNSResolver; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; -} - -declare var XPathEvaluator: { - prototype: XPathEvaluator; - new(): XPathEvaluator; -} - -interface XPathExpression { - evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression; -} - -declare var XPathExpression: { - prototype: XPathExpression; - new(): XPathExpression; -} - -interface XPathNSResolver { - lookupNamespaceURI(prefix: string): string; -} - -declare var XPathNSResolver: { - prototype: XPathNSResolver; - new(): XPathNSResolver; -} - -interface XPathResult { - booleanValue: boolean; - invalidIteratorState: boolean; - numberValue: number; - resultType: number; - singleNodeValue: Node; - snapshotLength: number; - stringValue: string; - iterateNext(): Node; - snapshotItem(index: number): Node; - ANY_TYPE: number; - ANY_UNORDERED_NODE_TYPE: number; - BOOLEAN_TYPE: number; - FIRST_ORDERED_NODE_TYPE: number; - NUMBER_TYPE: number; - ORDERED_NODE_ITERATOR_TYPE: number; - ORDERED_NODE_SNAPSHOT_TYPE: number; - STRING_TYPE: number; - UNORDERED_NODE_ITERATOR_TYPE: number; - UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -declare var XPathResult: { - prototype: XPathResult; - new(): XPathResult; - ANY_TYPE: number; - ANY_UNORDERED_NODE_TYPE: number; - BOOLEAN_TYPE: number; - FIRST_ORDERED_NODE_TYPE: number; - NUMBER_TYPE: number; - ORDERED_NODE_ITERATOR_TYPE: number; - ORDERED_NODE_SNAPSHOT_TYPE: number; - STRING_TYPE: number; - UNORDERED_NODE_ITERATOR_TYPE: number; - UNORDERED_NODE_SNAPSHOT_TYPE: number; -} - -interface XSLTProcessor { - clearParameters(): void; - getParameter(namespaceURI: string, localName: string): any; - importStylesheet(style: Node): void; - removeParameter(namespaceURI: string, localName: string): void; - reset(): void; - setParameter(namespaceURI: string, localName: string, value: any): void; - transformToDocument(source: Node): Document; - transformToFragment(source: Node, document: Document): DocumentFragment; -} - -declare var XSLTProcessor: { - prototype: XSLTProcessor; - new(): XSLTProcessor; -} - -interface AbstractWorker { - onerror: (ev: Event) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface ChildNode { - remove(): void; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface DocumentEvent { - createEvent(eventInterface:"AnimationEvent"): AnimationEvent; - createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; - createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; - createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; - createEvent(eventInterface:"CloseEvent"): CloseEvent; - createEvent(eventInterface:"CommandEvent"): CommandEvent; - createEvent(eventInterface:"CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface:"DragEvent"): DragEvent; - createEvent(eventInterface:"ErrorEvent"): ErrorEvent; - createEvent(eventInterface:"Event"): Event; - createEvent(eventInterface:"Events"): Event; - createEvent(eventInterface:"FocusEvent"): FocusEvent; - createEvent(eventInterface:"GamepadEvent"): GamepadEvent; - createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; - createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; - createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; - createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; - createEvent(eventInterface:"MessageEvent"): MessageEvent; - createEvent(eventInterface:"MouseEvent"): MouseEvent; - createEvent(eventInterface:"MouseEvents"): MouseEvent; - createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface:"MutationEvent"): MutationEvent; - createEvent(eventInterface:"MutationEvents"): MutationEvent; - createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface:"NavigationEvent"): NavigationEvent; - createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; - createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; - createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; - createEvent(eventInterface:"PointerEvent"): PointerEvent; - createEvent(eventInterface:"PopStateEvent"): PopStateEvent; - createEvent(eventInterface:"ProgressEvent"): ProgressEvent; - createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; - createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; - createEvent(eventInterface:"StorageEvent"): StorageEvent; - createEvent(eventInterface:"TextEvent"): TextEvent; - createEvent(eventInterface:"TouchEvent"): TouchEvent; - createEvent(eventInterface:"TrackEvent"): TrackEvent; - createEvent(eventInterface:"TransitionEvent"): TransitionEvent; - createEvent(eventInterface:"UIEvent"): UIEvent; - createEvent(eventInterface:"UIEvents"): UIEvent; - createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface:"WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface ElementTraversal { - childElementCount: number; - firstElementChild: Element; - lastElementChild: Element; - nextElementSibling: Element; - previousElementSibling: Element; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface GlobalEventHandlers { - onpointercancel: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerenter: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onwheel: (ev: WheelEvent) => any; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; -} - -interface IDBEnvironment { - indexedDB: IDBFactory; - msIndexedDB: IDBFactory; -} - -interface LinkStyle { - sheet: StyleSheet; -} - -interface MSBaseReader { - onabort: (ev: Event) => any; - onerror: (ev: Event) => any; - onload: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - onloadstart: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - readyState: number; - result: any; - abort(): void; - DONE: number; - EMPTY: number; - LOADING: number; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSNavigatorDoNotTrack { - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; -} - -interface NavigatorContentUtils { -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorID { - appName: string; - appVersion: string; - platform: string; - product: string; - productSub: string; - userAgent: string; - vendor: string; - vendorSub: string; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface NavigatorStorageUtils { -} - -interface NodeSelector { - querySelector(selectors: string): Element; - querySelectorAll(selectors: string): NodeList; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface SVGAnimatedPoints { - animatedPoints: SVGPointList; - points: SVGPointList; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - height: SVGAnimatedLength; - result: SVGAnimatedString; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - y: SVGAnimatedLength; -} - -interface SVGFitToViewBox { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - viewBox: SVGAnimatedRect; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; - getTransformToElement(element: SVGElement): SVGMatrix; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTests { - requiredExtensions: SVGStringList; - requiredFeatures: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface WindowBase64 { - atob(encodedString: string): string; - btoa(rawString: string): string; -} - -interface WindowConsole { - console: Console; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface WindowTimers extends Object, WindowTimersExtension { - clearInterval(handle: number): void; - clearTimeout(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; -} - -interface WindowTimersExtension { - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - msSetImmediate(expression: any, ...args: any[]): number; - setImmediate(expression: any, ...args: any[]): number; -} - -interface XMLHttpRequestEventTarget { - onabort: (ev: Event) => any; - onerror: (ev: Event) => any; - onload: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - onloadstart: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - ontimeout: (ev: ProgressEvent) => any; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -} - - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface EventListenerObject { - handleEvent(evt: Event): void; -} - -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; - -interface ErrorEventHandler { - (event: Event, source?: string, fileno?: number, columnNumber?: number): void; - (event: string, source?: string, fileno?: number, columnNumber?: number): void; -} -interface PositionCallback { - (position: Position): void; -} -interface PositionErrorCallback { - (error: PositionError): void; -} -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} -interface MSLaunchUriCallback { - (): void; -} -interface FrameRequestCallback { - (time: number): void; -} -interface MSUnsafeFunctionCallback { - (): any; -} -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} -interface DecodeSuccessCallback { - (decodedData: AudioBuffer): void; -} -interface DecodeErrorCallback { - (): void; -} -interface FunctionStringCallback { - (data: string): void; -} -declare var Audio: {new(src?: string): HTMLAudioElement; }; -declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; -declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; -declare var animationStartTime: number; -declare var applicationCache: ApplicationCache; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var crypto: Crypto; -declare var defaultStatus: string; -declare var devicePixelRatio: number; -declare var doNotTrack: string; -declare var document: Document; -declare var event: Event; -declare var external: External; -declare var frameElement: Element; -declare var frames: Window; -declare var history: History; -declare var innerHeight: number; -declare var innerWidth: number; -declare var length: number; -declare var location: Location; -declare var locationbar: BarProp; -declare var menubar: BarProp; -declare var msAnimationStartTime: number; -declare var msTemplatePrinter: MSTemplatePrinter; -declare var name: string; -declare var navigator: Navigator; -declare var offscreenBuffering: string | boolean; -declare var onabort: (ev: Event) => any; -declare var onafterprint: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onblur: (ev: FocusEvent) => any; -declare var oncanplay: (ev: Event) => any; -declare var oncanplaythrough: (ev: Event) => any; -declare var onchange: (ev: Event) => any; -declare var onclick: (ev: MouseEvent) => any; -declare var oncompassneedscalibration: (ev: Event) => any; -declare var oncontextmenu: (ev: PointerEvent) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var ondragend: (ev: DragEvent) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrop: (ev: DragEvent) => any; -declare var ondurationchange: (ev: Event) => any; -declare var onemptied: (ev: Event) => any; -declare var onended: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onfocus: (ev: FocusEvent) => any; -declare var onhashchange: (ev: HashChangeEvent) => any; -declare var oninput: (ev: Event) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onload: (ev: Event) => any; -declare var onloadeddata: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onloadstart: (ev: Event) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onmouseover: (ev: MouseEvent) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onmsgesturechange: (ev: MSGestureEvent) => any; -declare var onmsgesturedoubletap: (ev: MSGestureEvent) => any; -declare var onmsgestureend: (ev: MSGestureEvent) => any; -declare var onmsgesturehold: (ev: MSGestureEvent) => any; -declare var onmsgesturestart: (ev: MSGestureEvent) => any; -declare var onmsgesturetap: (ev: MSGestureEvent) => any; -declare var onmsinertiastart: (ev: MSGestureEvent) => any; -declare var onmspointercancel: (ev: MSPointerEvent) => any; -declare var onmspointerdown: (ev: MSPointerEvent) => any; -declare var onmspointerenter: (ev: MSPointerEvent) => any; -declare var onmspointerleave: (ev: MSPointerEvent) => any; -declare var onmspointermove: (ev: MSPointerEvent) => any; -declare var onmspointerout: (ev: MSPointerEvent) => any; -declare var onmspointerover: (ev: MSPointerEvent) => any; -declare var onmspointerup: (ev: MSPointerEvent) => any; -declare var onoffline: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var onorientationchange: (ev: Event) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var onpause: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onplaying: (ev: Event) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onprogress: (ev: ProgressEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onreadystatechange: (ev: ProgressEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var onselect: (ev: UIEvent) => any; -declare var onstalled: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var ontouchcancel: any; -declare var ontouchend: any; -declare var ontouchmove: any; -declare var ontouchstart: any; -declare var onunload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var onwaiting: (ev: Event) => any; -declare var opener: Window; -declare var orientation: string; -declare var outerHeight: number; -declare var outerWidth: number; -declare var pageXOffset: number; -declare var pageYOffset: number; -declare var parent: Window; -declare var performance: Performance; -declare var personalbar: BarProp; -declare var screen: Screen; -declare var screenLeft: number; -declare var screenTop: number; -declare var screenX: number; -declare var screenY: number; -declare var scrollX: number; -declare var scrollY: number; -declare var scrollbars: BarProp; -declare var self: Window; -declare var status: string; -declare var statusbar: BarProp; -declare var styleMedia: StyleMedia; -declare var toolbar: BarProp; -declare var top: Window; -declare var window: Window; -declare function alert(message?: any): void; -declare function blur(): void; -declare function cancelAnimationFrame(handle: number): void; -declare function captureEvents(): void; -declare function close(): void; -declare function confirm(message?: string): boolean; -declare function focus(): void; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; -declare function getSelection(): Selection; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function moveBy(x?: number, y?: number): void; -declare function moveTo(x?: number, y?: number): void; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string; -declare function releaseEvents(): void; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function resizeBy(x?: number, y?: number): void; -declare function resizeTo(x?: number, y?: number): void; -declare function scroll(x?: number, y?: number): void; -declare function scrollBy(x?: number, y?: number): void; -declare function scrollTo(x?: number, y?: number): void; -declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; -declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; -declare function toString(): string; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -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: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function msClearImmediate(handle: number): void; -declare function msSetImmediate(expression: any, ...args: any[]): number; -declare function setImmediate(expression: any, ...args: any[]): number; -declare var sessionStorage: Storage; -declare var localStorage: Storage; -declare var console: Console; -declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerleave: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; -declare var onwheel: (ev: WheelEvent) => any; -declare var indexedDB: IDBFactory; -declare var msIndexedDB: IDBFactory; -declare function atob(encodedString: string): string; -declare function btoa(rawString: string): string; -declare function addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// These are only available in a Web Worker -declare function importScripts(...urls: string[]): void; - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - - -interface ActiveXObject { - new (s: string): any; -} -declare var ActiveXObject: ActiveXObject; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -interface TextStreamBase { - /** - * The column number of the current character position in an input stream. - */ - Column: number; - - /** - * The current line number in an input stream. - */ - Line: number; - - /** - * Closes a text stream. - * It is not necessary to close standard streams; they close automatically when the process ends. If - * you close a standard stream, be aware that any other pointers to that standard stream become invalid. - */ - Close(): void; -} - -interface TextStreamWriter extends TextStreamBase { - /** - * Sends a string to an output stream. - */ - Write(s: string): void; - - /** - * Sends a specified number of blank lines (newline characters) to an output stream. - */ - WriteBlankLines(intLines: number): void; - - /** - * Sends a string followed by a newline character to an output stream. - */ - WriteLine(s: string): void; -} - -interface TextStreamReader extends TextStreamBase { - /** - * Returns a specified number of characters from an input stream, starting at the current pointer position. - * Does not return until the ENTER key is pressed. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - Read(characters: number): string; - - /** - * Returns all characters from an input stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadAll(): string; - - /** - * Returns an entire line from an input stream. - * Although this method extracts the newline character, it does not add it to the returned string. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - */ - ReadLine(): string; - - /** - * Skips a specified number of characters when reading from an input text stream. - * Can only be used on a stream in reading mode; causes an error in writing or appending mode. - * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) - */ - Skip(characters: number): void; - - /** - * Skips the next line when reading from an input text stream. - * Can only be used on a stream in reading mode, not writing or appending mode. - */ - SkipLine(): void; - - /** - * Indicates whether the stream pointer position is at the end of a line. - */ - AtEndOfLine: boolean; - - /** - * Indicates whether the stream pointer position is at the end of a stream. - */ - AtEndOfStream: boolean; -} - -declare var WScript: { - /** - * Outputs text to either a message box (under WScript.exe) or the command console window followed by - * a newline (under CScript.exe). - */ - Echo(s: any): void; - - /** - * Exposes the write-only error output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdErr: TextStreamWriter; - - /** - * Exposes the write-only output stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdOut: TextStreamWriter; - Arguments: { length: number; Item(n: number): string; }; - - /** - * The full path of the currently running script. - */ - ScriptFullName: string; - - /** - * Forces the script to stop immediately, with an optional exit code. - */ - Quit(exitCode?: number): number; - - /** - * The Windows Script Host build version number. - */ - BuildVersion: number; - - /** - * Fully qualified path of the host executable. - */ - FullName: string; - - /** - * Gets/sets the script mode - interactive(true) or batch(false). - */ - Interactive: boolean; - - /** - * The name of the host executable (WScript.exe or CScript.exe). - */ - Name: string; - - /** - * Path of the directory containing the host executable. - */ - Path: string; - - /** - * The filename of the currently running script. - */ - ScriptName: string; - - /** - * Exposes the read-only input stream for the current script. - * Can be accessed only while using CScript.exe. - */ - StdIn: TextStreamReader; - - /** - * Windows Script Host version - */ - Version: string; - - /** - * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. - */ - ConnectObject(objEventSource: any, strPrefix: string): void; - - /** - * Creates a COM object. - * @param strProgiID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - CreateObject(strProgID: string, strPrefix?: string): any; - - /** - * Disconnects a COM object from its event sources. - */ - DisconnectObject(obj: any): void; - - /** - * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. - * @param strPathname Fully qualified path to the file containing the object persisted to disk. - * For objects in memory, pass a zero-length string. - * @param strProgID - * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. - */ - GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; - - /** - * Suspends script execution for a specified length of time, then continues execution. - * @param intTime Interval (in milliseconds) to suspend script execution. - */ - Sleep(intTime: number): void; -}; - -/** - * Allows enumerating over a COM collection, which may not have indexed item access. - */ -interface Enumerator { - /** - * Returns true if the current item is the last one in the collection, or the collection is empty, - * or the current item is undefined. - */ - atEnd(): boolean; - - /** - * Returns the current item in the collection - */ - item(): T; - - /** - * Resets the current item in the collection to the first item. If there are no items in the collection, - * the current item is set to undefined. - */ - moveFirst(): void; - - /** - * Moves the current item to the next item in the collection. If the enumerator is at the end of - * the collection or the collection is empty, the current item is set to undefined. - */ - moveNext(): void; -} - -interface EnumeratorConstructor { - new (collection: any): Enumerator; - new (collection: any): Enumerator; -} - -declare var Enumerator: EnumeratorConstructor; - -/** - * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. - */ -interface VBArray { - /** - * Returns the number of dimensions (1-based). - */ - dimensions(): number; - - /** - * Takes an index for each dimension in the array, and returns the item at the corresponding location. - */ - getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; - - /** - * Returns the smallest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - lbound(dimension?: number): number; - - /** - * Returns the largest available index for a given dimension. - * @param dimension 1-based dimension (defaults to 1) - */ - ubound(dimension?: number): number; - - /** - * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, - * each successive dimension is appended to the end of the array. - * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] - */ - toArray(): T[]; -} - -interface VBArrayConstructor { - new (safeArray: any): VBArray; - new (safeArray: any): VBArray; -} - -declare var VBArray: VBArrayConstructor; diff --git a/build/lib/typings/node.d.ts b/build/lib/typings/node.d.ts deleted file mode 100644 index f9b3a68a893..00000000000 --- a/build/lib/typings/node.d.ts +++ /dev/null @@ -1,1536 +0,0 @@ -// Type definitions for Node.js v0.12.0 -// Project: http://nodejs.org/ -// Definitions by: Microsoft TypeScript , DefinitelyTyped -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/************************************************ -* * -* Node.js v0.12.0 API * -* * -************************************************/ - -/************************************************ -* * -* GLOBAL * -* * -************************************************/ -declare var process: NodeJS.Process; -declare var global: NodeJS.Global; - -declare var __filename: string; -declare var __dirname: string; - -declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; -declare function clearTimeout(timeoutId: NodeJS.Timer): void; -declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; -declare function clearInterval(intervalId: NodeJS.Timer): void; -declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; -declare function clearImmediate(immediateId: any): void; - -declare var require: { - (id: string): any; - resolve(id:string): string; - cache: any; - extensions: any; - main: any; -}; - -declare var module: { - exports: any; - require(id: string): any; - id: string; - filename: string; - loaded: boolean; - parent: any; - children: any[]; -}; - -// Same as module.exports -declare var exports: any; -declare var SlowBuffer: { - new (str: string, encoding?: string): Buffer; - new (size: number): Buffer; - new (size: Uint8Array): Buffer; - new (array: any[]): Buffer; - prototype: Buffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: Buffer[], totalLength?: number): Buffer; -}; - - -// Buffer class -interface Buffer extends NodeBuffer {} -declare var Buffer: { - new (str: string, encoding?: string): Buffer; - new (size: number): Buffer; - new (size: Uint8Array): Buffer; - new (array: any[]): Buffer; - prototype: Buffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: Buffer[], totalLength?: number): Buffer; -}; - -/************************************************ -* * -* GLOBAL INTERFACES * -* * -************************************************/ -declare module NodeJS { - export interface ErrnoException extends Error { - errno?: number; - code?: string; - path?: string; - syscall?: string; - } - - export interface EventEmitter { - addListener(event: string, listener: Function): EventEmitter; - on(event: string, listener: Function): EventEmitter; - once(event: string, listener: Function): EventEmitter; - removeListener(event: string, listener: Function): EventEmitter; - removeAllListeners(event?: string): EventEmitter; - setMaxListeners(n: number): void; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - } - - export interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string|Buffer; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: ReadableStream): ReadableStream; - } - - export interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export interface ReadWriteStream extends ReadableStream, WritableStream {} - - export interface Process extends EventEmitter { - stdout: WritableStream; - stderr: WritableStream; - stdin: ReadableStream; - argv: string[]; - execPath: string; - abort(): void; - chdir(directory: string): void; - cwd(): string; - env: any; - exit(code?: number): void; - getgid(): number; - setgid(id: number): void; - setgid(id: string): void; - getuid(): number; - setuid(id: number): void; - setuid(id: string): void; - version: string; - versions: { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - openssl: string; - }; - config: { - target_defaults: { - cflags: any[]; - default_configuration: string; - defines: string[]; - include_dirs: string[]; - libraries: string[]; - }; - variables: { - clang: number; - host_arch: string; - node_install_npm: boolean; - node_install_waf: boolean; - node_prefix: string; - node_shared_openssl: boolean; - node_shared_v8: boolean; - node_shared_zlib: boolean; - node_use_dtrace: boolean; - node_use_etw: boolean; - node_use_openssl: boolean; - target_arch: string; - v8_no_strict_aliasing: number; - v8_use_snapshot: boolean; - visibility: string; - }; - }; - kill(pid: number, signal?: string): void; - pid: number; - title: string; - arch: string; - platform: string; - memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; }; - nextTick(callback: Function): void; - umask(mask?: number): number; - uptime(): number; - hrtime(time?:number[]): number[]; - - // Worker - send?(message: any, sendHandle?: any): void; - } - - export interface Global { - Array: typeof Array; - ArrayBuffer: typeof ArrayBuffer; - Boolean: typeof Boolean; - Buffer: typeof Buffer; - DataView: typeof DataView; - Date: typeof Date; - Error: typeof Error; - EvalError: typeof EvalError; - Float32Array: typeof Float32Array; - Float64Array: typeof Float64Array; - Function: typeof Function; - GLOBAL: Global; - Infinity: typeof Infinity; - Int16Array: typeof Int16Array; - Int32Array: typeof Int32Array; - Int8Array: typeof Int8Array; - Intl: typeof Intl; - JSON: typeof JSON; - Map: typeof Map; - Math: typeof Math; - NaN: typeof NaN; - Number: typeof Number; - Object: typeof Object; - Promise: Function; - RangeError: typeof RangeError; - ReferenceError: typeof ReferenceError; - RegExp: typeof RegExp; - Set: typeof Set; - String: typeof String; - Symbol: Function; - SyntaxError: typeof SyntaxError; - TypeError: typeof TypeError; - URIError: typeof URIError; - Uint16Array: typeof Uint16Array; - Uint32Array: typeof Uint32Array; - Uint8Array: typeof Uint8Array; - Uint8ClampedArray: Function; - WeakMap: typeof WeakMap; - WeakSet: Function; - clearImmediate: (immediateId: any) => void; - clearInterval: (intervalId: NodeJS.Timer) => void; - clearTimeout: (timeoutId: NodeJS.Timer) => void; - console: typeof console; - decodeURI: typeof decodeURI; - decodeURIComponent: typeof decodeURIComponent; - encodeURI: typeof encodeURI; - encodeURIComponent: typeof encodeURIComponent; - escape: (str: string) => string; - eval: typeof eval; - global: Global; - isFinite: typeof isFinite; - isNaN: typeof isNaN; - parseFloat: typeof parseFloat; - parseInt: typeof parseInt; - process: Process; - root: Global; - setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; - setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; - setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; - undefined: typeof undefined; - unescape: (str: string) => string; - gc: () => void; - } - - export interface Timer { - ref() : void; - unref() : void; - } -} - -/** - * @deprecated - */ -interface NodeBuffer { - [index: number]: number; - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): any; - length: number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - readUInt8(offset: number, noAsset?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - writeUInt8(value: number, offset: number, noAssert?: boolean): void; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): void; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): void; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): void; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): void; - writeInt8(value: number, offset: number, noAssert?: boolean): void; - writeInt16LE(value: number, offset: number, noAssert?: boolean): void; - writeInt16BE(value: number, offset: number, noAssert?: boolean): void; - writeInt32LE(value: number, offset: number, noAssert?: boolean): void; - writeInt32BE(value: number, offset: number, noAssert?: boolean): void; - writeFloatLE(value: number, offset: number, noAssert?: boolean): void; - writeFloatBE(value: number, offset: number, noAssert?: boolean): void; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): void; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): void; - fill(value: any, offset?: number, end?: number): void; -} - -/************************************************ -* * -* MODULES * -* * -************************************************/ -declare module "buffer" { - export var INSPECT_MAX_BYTES: number; -} - -declare module "querystring" { - export function stringify(obj: any, sep?: string, eq?: string): string; - export function parse(str: string, sep?: string, eq?: string, options?: { maxKeys?: number; }): any; - export function escape(str: string): string; - export function unescape(str: string): string; -} - -declare module "events" { - export class EventEmitter implements NodeJS.EventEmitter { - static listenerCount(emitter: EventEmitter, event: string): number; - - addListener(event: string, listener: Function): EventEmitter; - on(event: string, listener: Function): EventEmitter; - once(event: string, listener: Function): EventEmitter; - removeListener(event: string, listener: Function): EventEmitter; - removeAllListeners(event?: string): EventEmitter; - setMaxListeners(n: number): void; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - } -} - -declare module "http" { - import events = require("events"); - import net = require("net"); - import stream = require("stream"); - - export interface Server extends events.EventEmitter { - listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server; - listen(port: number, hostname?: string, callback?: Function): Server; - listen(path: string, callback?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - close(cb?: any): Server; - address(): { port: number; family: string; address: string; }; - maxHeadersCount: number; - } - /** - * @deprecated Use IncomingMessage - */ - export interface ServerRequest extends IncomingMessage { - connection: net.Socket; - } - export interface ServerResponse extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - writeContinue(): void; - writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; - writeHead(statusCode: number, headers?: any): void; - statusCode: number; - setHeader(name: string, value: string): void; - sendDate: boolean; - getHeader(name: string): string; - removeHeader(name: string): void; - write(chunk: any, encoding?: string): any; - addTrailers(headers: any): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - export interface ClientRequest extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - write(chunk: any, encoding?: string): void; - abort(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: boolean): void; - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - export interface IncomingMessage extends events.EventEmitter, stream.Readable { - httpVersion: string; - headers: any; - rawHeaders: string[]; - trailers: any; - rawTrailers: any; - setTimeout(msecs: number, callback: Function): NodeJS.Timer; - /** - * Only valid for request obtained from http.Server. - */ - method?: string; - /** - * Only valid for request obtained from http.Server. - */ - url?: string; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusCode?: number; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusMessage?: string; - socket: net.Socket; - } - /** - * @deprecated Use IncomingMessage - */ - export interface ClientResponse extends IncomingMessage { } - - export interface AgentOptions { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number; - } - - export class Agent { - maxSockets: number; - sockets: any; - requests: any; - - constructor(opts?: AgentOptions); - - /** - * Destroy any sockets that are currently in use by the agent. - * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, - * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, - * sockets may hang open for quite a long time before the server terminates them. - */ - destroy(): void; - } - - export var STATUS_CODES: { - [errorCode: number]: string; - [errorCode: string]: string; - }; - export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; - export function createClient(port?: number, host?: string): any; - export function request(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; - export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; - export var globalAgent: Agent; -} - -declare module "cluster" { - import child = require("child_process"); - import events = require("events"); - - export interface ClusterSettings { - exec?: string; - args?: string[]; - silent?: boolean; - } - - export class Worker extends events.EventEmitter { - id: string; - process: child.ChildProcess; - suicide: boolean; - send(message: any, sendHandle?: any): void; - kill(signal?: string): void; - destroy(signal?: string): void; - disconnect(): void; - } - - export var settings: ClusterSettings; - export var isMaster: boolean; - export var isWorker: boolean; - export function setupMaster(settings?: ClusterSettings): void; - export function fork(env?: any): Worker; - export function disconnect(callback?: Function): void; - export var worker: Worker; - export var workers: Worker[]; - - // Event emitter - export function addListener(event: string, listener: Function): void; - export function on(event: string, listener: Function): any; - export function once(event: string, listener: Function): void; - export function removeListener(event: string, listener: Function): void; - export function removeAllListeners(event?: string): void; - export function setMaxListeners(n: number): void; - export function listeners(event: string): Function[]; - export function emit(event: string, ...args: any[]): boolean; -} - -declare module "zlib" { - import stream = require("stream"); - export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } - - export interface Gzip extends stream.Transform { } - export interface Gunzip extends stream.Transform { } - export interface Deflate extends stream.Transform { } - export interface Inflate extends stream.Transform { } - export interface DeflateRaw extends stream.Transform { } - export interface InflateRaw extends stream.Transform { } - export interface Unzip extends stream.Transform { } - - export function createGzip(options?: ZlibOptions): Gzip; - export function createGunzip(options?: ZlibOptions): Gunzip; - export function createDeflate(options?: ZlibOptions): Deflate; - export function createInflate(options?: ZlibOptions): Inflate; - export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; - export function createInflateRaw(options?: ZlibOptions): InflateRaw; - export function createUnzip(options?: ZlibOptions): Unzip; - - export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - - // Constants - export var Z_NO_FLUSH: number; - export var Z_PARTIAL_FLUSH: number; - export var Z_SYNC_FLUSH: number; - export var Z_FULL_FLUSH: number; - export var Z_FINISH: number; - export var Z_BLOCK: number; - export var Z_TREES: number; - export var Z_OK: number; - export var Z_STREAM_END: number; - export var Z_NEED_DICT: number; - export var Z_ERRNO: number; - export var Z_STREAM_ERROR: number; - export var Z_DATA_ERROR: number; - export var Z_MEM_ERROR: number; - export var Z_BUF_ERROR: number; - export var Z_VERSION_ERROR: number; - export var Z_NO_COMPRESSION: number; - export var Z_BEST_SPEED: number; - export var Z_BEST_COMPRESSION: number; - export var Z_DEFAULT_COMPRESSION: number; - export var Z_FILTERED: number; - export var Z_HUFFMAN_ONLY: number; - export var Z_RLE: number; - export var Z_FIXED: number; - export var Z_DEFAULT_STRATEGY: number; - export var Z_BINARY: number; - export var Z_TEXT: number; - export var Z_ASCII: number; - export var Z_UNKNOWN: number; - export var Z_DEFLATED: number; - export var Z_NULL: number; -} - -declare module "os" { - export function tmpdir(): string; - export function hostname(): string; - export function type(): string; - export function platform(): string; - export function arch(): string; - export function release(): string; - export function uptime(): number; - export function loadavg(): number[]; - export function totalmem(): number; - export function freemem(): number; - export function cpus(): { model: string; speed: number; times: { user: number; nice: number; sys: number; idle: number; irq: number; }; }[]; - export function networkInterfaces(): any; - export var EOL: string; -} - -declare module "https" { - import tls = require("tls"); - import events = require("events"); - import http = require("http"); - - export interface ServerOptions { - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - crl?: any; - ciphers?: string; - honorCipherOrder?: boolean; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; - SNICallback?: (servername: string) => any; - } - - export interface RequestOptions { - host?: string; - hostname?: string; - port?: number; - path?: string; - method?: string; - headers?: any; - auth?: string; - agent?: any; - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - ciphers?: string; - rejectUnauthorized?: boolean; - } - - export interface Agent { - maxSockets: number; - sockets: any; - requests: any; - } - export var Agent: { - new (options?: RequestOptions): Agent; - }; - export interface Server extends tls.Server { } - export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export var globalAgent: Agent; -} - -declare module "punycode" { - export function decode(string: string): string; - export function encode(string: string): string; - export function toUnicode(domain: string): string; - export function toASCII(domain: string): string; - export var ucs2: ucs2; - interface ucs2 { - decode(string: string): string; - encode(codePoints: number[]): string; - } - export var version: any; -} - -declare module "repl" { - import stream = require("stream"); - import events = require("events"); - - export interface ReplOptions { - prompt?: string; - input?: NodeJS.ReadableStream; - output?: NodeJS.WritableStream; - terminal?: boolean; - eval?: Function; - useColors?: boolean; - useGlobal?: boolean; - ignoreUndefined?: boolean; - writer?: Function; - } - export function start(options: ReplOptions): events.EventEmitter; -} - -declare module "readline" { - import events = require("events"); - import stream = require("stream"); - - export interface ReadLine extends events.EventEmitter { - setPrompt(prompt: string, length: number): void; - prompt(preserveCursor?: boolean): void; - question(query: string, callback: Function): void; - pause(): void; - resume(): void; - close(): void; - write(data: any, key?: any): void; - } - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output: NodeJS.WritableStream; - completer?: Function; - terminal?: boolean; - } - export function createInterface(options: ReadLineOptions): ReadLine; -} - -declare module "vm" { - export interface Context { } - export interface Script { - runInThisContext(): void; - runInNewContext(sandbox?: Context): void; - } - export function runInThisContext(code: string, filename?: string): void; - export function runInNewContext(code: string, sandbox?: Context, filename?: string): void; - export function runInContext(code: string, context: Context, filename?: string): void; - export function createContext(initSandbox?: Context): Context; - export function createScript(code: string, filename?: string): Script; -} - -declare module "child_process" { - import events = require("events"); - import stream = require("stream"); - - export interface ChildProcess extends events.EventEmitter { - stdin: stream.Writable; - stdout: stream.Readable; - stderr: stream.Readable; - pid: number; - kill(signal?: string): void; - send(message: any, sendHandle?: any): void; - disconnect(): void; - } - - export function spawn(command: string, args?: string[], options?: { - cwd?: string; - stdio?: any; - custom?: any; - env?: any; - detached?: boolean; - }): ChildProcess; - export function exec(command: string, options: { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, - callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], - callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], options?: { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: string; - killSignal?: string; - }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function fork(modulePath: string, args?: string[], options?: { - cwd?: string; - env?: any; - encoding?: string; - }): ChildProcess; - export function execSync(command: string, options?: { - cwd?: string; - input?: string|Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - encoding?: string; - }): ChildProcess; - export function execFileSync(command: string, args?: string[], options?: { - cwd?: string; - input?: string|Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - encoding?: string; - }): ChildProcess; -} - -declare module "url" { - export interface Url { - href: string; - protocol: string; - auth: string; - hostname: string; - port: string; - host: string; - pathname: string; - search: string; - query: any; // string | Object - slashes: boolean; - hash?: string; - path?: string; - } - - export interface UrlOptions { - protocol?: string; - auth?: string; - hostname?: string; - port?: string; - host?: string; - pathname?: string; - search?: string; - query?: any; - hash?: string; - path?: string; - } - - export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; - export function format(url: UrlOptions): string; - export function resolve(from: string, to: string): string; -} - -declare module "dns" { - export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; - export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; - export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; -} - -declare module "net" { - import stream = require("stream"); - - export interface Socket extends stream.Duplex { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - connect(port: number, host?: string, connectionListener?: Function): void; - connect(path: string, connectionListener?: Function): void; - bufferSize: number; - setEncoding(encoding?: string): void; - write(data: any, encoding?: string, callback?: Function): void; - destroy(): void; - pause(): void; - resume(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: boolean): void; - setKeepAlive(enable?: boolean, initialDelay?: number): void; - address(): { port: number; family: string; address: string; }; - unref(): void; - ref(): void; - - remoteAddress: string; - remoteFamily: string; - remotePort: number; - localAddress: string; - localPort: number; - bytesRead: number; - bytesWritten: number; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - - export var Socket: { - new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; - }; - - export interface Server extends Socket { - listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; - listen(path: string, listeningListener?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - close(callback?: Function): Server; - address(): { port: number; family: string; address: string; }; - maxConnections: number; - connections: number; - } - export function createServer(connectionListener?: (socket: Socket) =>void ): Server; - export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; - export function connect(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; - export function connect(port: number, host?: string, connectionListener?: Function): Socket; - export function connect(path: string, connectionListener?: Function): Socket; - export function createConnection(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; - export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; - export function createConnection(path: string, connectionListener?: Function): Socket; - export function isIP(input: string): number; - export function isIPv4(input: string): boolean; - export function isIPv6(input: string): boolean; -} - -declare module "dgram" { - import events = require("events"); - - interface RemoteInfo { - address: string; - port: number; - size: number; - } - - interface AddressInfo { - address: string; - family: string; - port: number; - } - - export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - - interface Socket extends events.EventEmitter { - send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; - bind(port: number, address?: string, callback?: () => void): void; - close(): void; - address(): AddressInfo; - setBroadcast(flag: boolean): void; - setMulticastTTL(ttl: number): void; - setMulticastLoopback(flag: boolean): void; - addMembership(multicastAddress: string, multicastInterface?: string): void; - dropMembership(multicastAddress: string, multicastInterface?: string): void; - } -} - -declare module "fs" { - import stream = require("stream"); - import events = require("events"); - - interface Stats { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atime: Date; - mtime: Date; - ctime: Date; - } - - interface FSWatcher extends events.EventEmitter { - close(): void; - } - - export interface ReadStream extends stream.Readable { - close(): void; - } - export interface WriteStream extends stream.Writable { - close(): void; - } - - export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function renameSync(oldPath: string, newPath: string): void; - export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncateSync(path: string, len?: number): void; - export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function ftruncateSync(fd: number, len?: number): void; - export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chownSync(path: string, uid: number, gid: number): void; - export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchownSync(fd: number, uid: number, gid: number): void; - export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchownSync(path: string, uid: number, gid: number): void; - export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmodSync(path: string, mode: number): void; - export function chmodSync(path: string, mode: string): void; - export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchmodSync(fd: number, mode: number): void; - export function fchmodSync(fd: number, mode: string): void; - export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmodSync(path: string, mode: number): void; - export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function statSync(path: string): Stats; - export function lstatSync(path: string): Stats; - export function fstatSync(fd: number): Stats; - export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function linkSync(srcpath: string, dstpath: string): void; - export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; - export function readlinkSync(path: string): string; - export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; - export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; - export function realpathSync(path: string, cache?: {[path: string]: string}): string; - export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function unlinkSync(path: string): void; - export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function rmdirSync(path: string): void; - export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function mkdirSync(path: string, mode?: number): void; - export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; - export function readdirSync(path: string): string[]; - export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function closeSync(fd: number): void; - export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function openSync(path: string, flags: string, mode?: number): number; - export function openSync(path: string, flags: string, mode?: string): number; - export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimesSync(path: string, atime: number, mtime: number): void; - export function utimesSync(path: string, atime: Date, mtime: Date): void; - export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function futimesSync(fd: number, atime: number, mtime: number): void; - export function futimesSync(fd: number, atime: Date, mtime: Date): void; - export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fsyncSync(fd: number): void; - export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; - export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; - export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; - export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; - export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void ): void; - export function readFileSync(filename: string, encoding: string): string; - export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; - export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; - export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; - export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; - export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; - export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; - export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; - export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; - export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; - export function exists(path: string, callback?: (exists: boolean) => void): void; - export function existsSync(path: string): boolean; - export function createReadStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: string; - mode?: number; - bufferSize?: number; - }): ReadStream; - export function createReadStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: string; - mode?: string; - bufferSize?: number; - }): ReadStream; - export function createWriteStream(path: string, options?: { - flags?: string; - encoding?: string; - string?: string; - }): WriteStream; -} - -declare module "path" { - - export interface ParsedPath { - root: string; - dir: string; - base: string; - ext: string; - name: string; - } - - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - - export module posix { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - } - - export module win32 { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - } -} - -declare module "string_decoder" { - export interface NodeStringDecoder { - write(buffer: Buffer): string; - detectIncompleteChar(buffer: Buffer): number; - } - export var StringDecoder: { - new (encoding: string): NodeStringDecoder; - }; -} - -declare module "tls" { - import crypto = require("crypto"); - import net = require("net"); - import stream = require("stream"); - - var CLIENT_RENEG_LIMIT: number; - var CLIENT_RENEG_WINDOW: number; - - export interface TlsOptions { - pfx?: any; //string or buffer - key?: any; //string or buffer - passphrase?: string; - cert?: any; - ca?: any; //string or buffer - crl?: any; //string or string array - ciphers?: string; - honorCipherOrder?: any; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; //array or Buffer; - SNICallback?: (servername: string) => any; - } - - export interface ConnectionOptions { - host?: string; - port?: number; - socket?: net.Socket; - pfx?: any; //string | Buffer - key?: any; //string | Buffer - passphrase?: string; - cert?: any; //string | Buffer - ca?: any; //Array of string | Buffer - rejectUnauthorized?: boolean; - NPNProtocols?: any; //Array of string | Buffer - servername?: string; - } - - export interface Server extends net.Server { - // Extended base methods - listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; - listen(path: string, listeningListener?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - - listen(port: number, host?: string, callback?: Function): Server; - close(): Server; - address(): { port: number; family: string; address: string; }; - addContext(hostName: string, credentials: { - key: string; - cert: string; - ca: string; - }): void; - maxConnections: number; - connections: number; - } - - export interface ClearTextStream extends stream.Duplex { - authorized: boolean; - authorizationError: Error; - getPeerCertificate(): any; - getCipher: { - name: string; - version: string; - }; - address: { - port: number; - family: string; - address: string; - }; - remoteAddress: string; - remotePort: number; - } - - export interface SecurePair { - encrypted: any; - cleartext: any; - } - - export interface SecureContextOptions { - pfx?: any; //string | buffer - key?: any; //string | buffer - passphrase?: string; - cert?: any; // string | buffer - ca?: any; // string | buffer - crl?: any; // string | string[] - ciphers?: string; - honorCipherOrder?: boolean; - } - - export interface SecureContext { - context: any; - } - - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; - export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - export function createSecureContext(details: SecureContextOptions): SecureContext; -} - -declare module "crypto" { - export interface CredentialDetails { - pfx: string; - key: string; - passphrase: string; - cert: string; - ca: any; //string | string array - crl: any; //string | string array - ciphers: string; - } - export interface Credentials { context?: any; } - export function createCredentials(details: CredentialDetails): Credentials; - export function createHash(algorithm: string): Hash; - export function createHmac(algorithm: string, key: string): Hmac; - export function createHmac(algorithm: string, key: Buffer): Hmac; - interface Hash { - update(data: any, input_encoding?: string): Hash; - digest(encoding: 'buffer'): Buffer; - digest(encoding: string): any; - digest(): Buffer; - } - interface Hmac { - update(data: any, input_encoding?: string): Hmac; - digest(encoding: 'buffer'): Buffer; - digest(encoding: string): any; - digest(): Buffer; - } - export function createCipher(algorithm: string, password: any): Cipher; - export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; - interface Cipher { - update(data: Buffer): Buffer; - update(data: string, input_encoding?: string, output_encoding?: string): string; - final(): Buffer; - final(output_encoding: string): string; - setAutoPadding(auto_padding: boolean): void; - } - export function createDecipher(algorithm: string, password: any): Decipher; - export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; - interface Decipher { - update(data: Buffer): Buffer; - update(data: string, input_encoding?: string, output_encoding?: string): string; - final(): Buffer; - final(output_encoding: string): string; - setAutoPadding(auto_padding: boolean): void; - } - export function createSign(algorithm: string): Signer; - interface Signer { - update(data: any): void; - sign(private_key: string, output_format: string): string; - } - export function createVerify(algorith: string): Verify; - interface Verify { - update(data: any): void; - verify(object: string, signature: string, signature_format?: string): boolean; - } - export function createDiffieHellman(prime_length: number): DiffieHellman; - export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; - interface DiffieHellman { - generateKeys(encoding?: string): string; - computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; - getPrime(encoding?: string): string; - getGenerator(encoding: string): string; - getPublicKey(encoding?: string): string; - getPrivateKey(encoding?: string): string; - setPublicKey(public_key: string, encoding?: string): void; - setPrivateKey(public_key: string, encoding?: string): void; - } - export function getDiffieHellman(group_name: string): DiffieHellman; - export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2Sync(password: string, salt: string, iterations: number, keylen: number) : Buffer; - export function randomBytes(size: number): Buffer; - export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; - export function pseudoRandomBytes(size: number): Buffer; - export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; -} - -declare module "stream" { - import events = require("events"); - - export interface Stream extends events.EventEmitter { - pipe(destination: T, options?: { end?: boolean; }): T; - } - - export interface ReadableOptions { - highWaterMark?: number; - encoding?: string; - objectMode?: boolean; - } - - export class Readable extends events.EventEmitter implements NodeJS.ReadableStream { - readable: boolean; - constructor(opts?: ReadableOptions); - _read(size: number): void; - read(size?: number): string|Buffer; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; - push(chunk: any, encoding?: string): boolean; - } - - export interface WritableOptions { - highWaterMark?: number; - decodeStrings?: boolean; - } - - export class Writable extends events.EventEmitter implements NodeJS.WritableStream { - writable: boolean; - constructor(opts?: WritableOptions); - _write(data: Buffer, encoding: string, callback: Function): void; - _write(data: string, encoding: string, callback: Function): void; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean; - } - - // Note: Duplex extends both Readable and Writable. - export class Duplex extends Readable implements NodeJS.ReadWriteStream { - writable: boolean; - constructor(opts?: DuplexOptions); - _write(data: Buffer, encoding: string, callback: Function): void; - _write(data: string, encoding: string, callback: Function): void; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export interface TransformOptions extends ReadableOptions, WritableOptions {} - - // Note: Transform lacks the _read and _write methods of Readable/Writable. - export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { - readable: boolean; - writable: boolean; - constructor(opts?: TransformOptions); - _transform(chunk: Buffer, encoding: string, callback: Function): void; - _transform(chunk: string, encoding: string, callback: Function): void; - _flush(callback: Function): void; - read(size?: number): any; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; - push(chunk: any, encoding?: string): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export class PassThrough extends Transform {} -} - -declare module "util" { - export interface InspectOptions { - showHidden?: boolean; - depth?: number; - colors?: boolean; - customInspect?: boolean; - } - - export function format(format: any, ...param: any[]): string; - export function debug(string: string): void; - export function error(...param: any[]): void; - export function puts(...param: any[]): void; - export function print(...param: any[]): void; - export function log(string: string): void; - export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string; - export function inspect(object: any, options: InspectOptions): string; - export function isArray(object: any): boolean; - export function isRegExp(object: any): boolean; - export function isDate(object: any): boolean; - export function isError(object: any): boolean; - export function inherits(constructor: any, superConstructor: any): void; -} - -declare module "assert" { - function internal (value: any, message?: string): void; - module internal { - export class AssertionError implements Error { - name: string; - message: string; - actual: any; - expected: any; - operator: string; - generatedMessage: boolean; - - constructor(options?: {message?: string; actual?: any; expected?: any; - operator?: string; stackStartFunction?: Function}); - } - - export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; - export function ok(value: any, message?: string): void; - export function equal(actual: any, expected: any, message?: string): void; - export function notEqual(actual: any, expected: any, message?: string): void; - export function deepEqual(actual: any, expected: any, message?: string): void; - export function notDeepEqual(acutal: any, expected: any, message?: string): void; - export function strictEqual(actual: any, expected: any, message?: string): void; - export function notStrictEqual(actual: any, expected: any, message?: string): void; - export var throws: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export var doesNotThrow: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export function ifError(value: any): void; - } - - export = internal; -} - -declare module "tty" { - import net = require("net"); - - export function isatty(fd: number): boolean; - export interface ReadStream extends net.Socket { - isRaw: boolean; - setRawMode(mode: boolean): void; - } - export interface WriteStream extends net.Socket { - columns: number; - rows: number; - } -} - -declare module "domain" { - import events = require("events"); - - export class Domain extends events.EventEmitter { - run(fn: Function): void; - add(emitter: events.EventEmitter): void; - remove(emitter: events.EventEmitter): void; - bind(cb: (err: Error, data: any) => any): any; - intercept(cb: (data: any) => any): any; - dispose(): void; - - addListener(event: string, listener: Function): Domain; - on(event: string, listener: Function): Domain; - once(event: string, listener: Function): Domain; - removeListener(event: string, listener: Function): Domain; - removeAllListeners(event?: string): Domain; - } - - export function create(): Domain; -} diff --git a/build/lib/util.js b/build/lib/util.js index 4ffed162246..8ce093e800f 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -1,213 +1,213 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -var es = require("event-stream"); -var debounce = require("debounce"); -var _filter = require("gulp-filter"); -var rename = require("gulp-rename"); -var _ = require("underscore"); -var path = require("path"); -var fs = require("fs"); -var _rimraf = require("rimraf"); -var git = require("./git"); -var VinylFile = require("vinyl"); -var NoCancellationToken = { isCancellationRequested: function () { return false; } }; -function incremental(streamProvider, initial, supportsCancellation) { - var input = es.through(); - var output = es.through(); - var state = 'idle'; - var buffer = Object.create(null); - var token = !supportsCancellation ? null : { isCancellationRequested: function () { return Object.keys(buffer).length > 0; } }; - var run = function (input, isCancellable) { - state = 'running'; - var stream = !supportsCancellation ? streamProvider() : streamProvider(isCancellable ? token : NoCancellationToken); - input - .pipe(stream) - .pipe(es.through(null, function () { - state = 'idle'; - eventuallyRun(); - })) - .pipe(output); - }; - if (initial) { - run(initial, false); - } - var eventuallyRun = debounce(function () { - var paths = Object.keys(buffer); - if (paths.length === 0) { - return; - } - var data = paths.map(function (path) { return buffer[path]; }); - buffer = Object.create(null); - run(es.readArray(data), true); - }, 500); - input.on('data', function (f) { - buffer[f.path] = f; - if (state === 'idle') { - eventuallyRun(); - } - }); - return es.duplex(input, output); -} -exports.incremental = incremental; -function fixWin32DirectoryPermissions() { - if (!/win32/.test(process.platform)) { - return es.through(); - } - return es.mapSync(function (f) { - if (f.stat && f.stat.isDirectory && f.stat.isDirectory()) { - f.stat.mode = 16877; - } - return f; - }); -} -exports.fixWin32DirectoryPermissions = fixWin32DirectoryPermissions; -function setExecutableBit(pattern) { - var setBit = es.mapSync(function (f) { - f.stat.mode = 33261; - return f; - }); - if (!pattern) { - return setBit; - } - var input = es.through(); - var filter = _filter(pattern, { restore: true }); - var output = input - .pipe(filter) - .pipe(setBit) - .pipe(filter.restore); - return es.duplex(input, output); -} -exports.setExecutableBit = setExecutableBit; -function toFileUri(filePath) { - var match = filePath.match(/^([a-z])\:(.*)$/i); - if (match) { - filePath = '/' + match[1].toUpperCase() + ':' + match[2]; - } - return 'file://' + filePath.replace(/\\/g, '/'); -} -exports.toFileUri = toFileUri; -function skipDirectories() { - return es.mapSync(function (f) { - if (!f.isDirectory()) { - return f; - } - }); -} -exports.skipDirectories = skipDirectories; -function cleanNodeModule(name, excludes, includes) { - var toGlob = function (path) { return '**/node_modules/' + name + (path ? '/' + path : ''); }; - var negate = function (str) { return '!' + str; }; - var allFilter = _filter(toGlob('**'), { restore: true }); - var globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob))); - var input = es.through(); - var nodeModuleInput = input.pipe(allFilter); - var output = nodeModuleInput.pipe(_filter(globs)); - if (includes) { - var includeGlobs = includes.map(toGlob); - output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs))); - } - output = output.pipe(allFilter.restore); - return es.duplex(input, output); -} -exports.cleanNodeModule = cleanNodeModule; -function loadSourcemaps() { - var input = es.through(); - var output = input - .pipe(es.map(function (f, cb) { - if (f.sourceMap) { - cb(null, f); - return; - } - if (!f.contents) { - cb(new Error('empty file')); - return; - } - var contents = f.contents.toString('utf8'); - var reg = /\/\/# sourceMappingURL=(.*)$/g; - var lastMatch = null, match = null; - while (match = reg.exec(contents)) { - lastMatch = match; - } - if (!lastMatch) { - f.sourceMap = { - version: 3, - names: [], - mappings: '', - sources: [f.relative.replace(/\//g, '/')], - sourcesContent: [contents] - }; - cb(null, f); - return; - } - f.contents = new Buffer(contents.replace(/\/\/# sourceMappingURL=(.*)$/g, ''), 'utf8'); - fs.readFile(path.join(path.dirname(f.path), lastMatch[1]), 'utf8', function (err, contents) { - if (err) { - return cb(err); - } - f.sourceMap = JSON.parse(contents); - cb(null, f); - }); - })); - return es.duplex(input, output); -} -exports.loadSourcemaps = loadSourcemaps; -function stripSourceMappingURL() { - var input = es.through(); - var output = input - .pipe(es.mapSync(function (f) { - var contents = f.contents.toString('utf8'); - f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8'); - return f; - })); - return es.duplex(input, output); -} -exports.stripSourceMappingURL = stripSourceMappingURL; -function rimraf(dir) { - var retries = 0; - var retry = function (cb) { - _rimraf(dir, { maxBusyTries: 1 }, function (err) { - if (!err) { - return cb(); - } - ; - if (err.code === 'ENOTEMPTY' && ++retries < 5) { - return setTimeout(function () { return retry(cb); }, 10); - } - return cb(err); - }); - }; - return function (cb) { return retry(cb); }; -} -exports.rimraf = rimraf; -function getVersion(root) { - var version = process.env['BUILD_SOURCEVERSION']; - if (!version || !/^[0-9a-f]{40}$/i.test(version)) { - version = git.getVersion(root); - } - return version; -} -exports.getVersion = getVersion; -function rebase(count) { - return rename(function (f) { - var parts = f.dirname.split(/[\/\\]/); - f.dirname = parts.slice(count).join(path.sep); - }); -} -exports.rebase = rebase; -function filter(fn) { - var result = es.through(function (data) { - if (fn(data)) { - this.emit('data', data); - } - else { - result.restore.push(data); - } - }); - result.restore = es.through(); - return result; -} -exports.filter = filter; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +var es = require("event-stream"); +var debounce = require("debounce"); +var _filter = require("gulp-filter"); +var rename = require("gulp-rename"); +var _ = require("underscore"); +var path = require("path"); +var fs = require("fs"); +var _rimraf = require("rimraf"); +var git = require("./git"); +var VinylFile = require("vinyl"); +var NoCancellationToken = { isCancellationRequested: function () { return false; } }; +function incremental(streamProvider, initial, supportsCancellation) { + var input = es.through(); + var output = es.through(); + var state = 'idle'; + var buffer = Object.create(null); + var token = !supportsCancellation ? null : { isCancellationRequested: function () { return Object.keys(buffer).length > 0; } }; + var run = function (input, isCancellable) { + state = 'running'; + var stream = !supportsCancellation ? streamProvider() : streamProvider(isCancellable ? token : NoCancellationToken); + input + .pipe(stream) + .pipe(es.through(null, function () { + state = 'idle'; + eventuallyRun(); + })) + .pipe(output); + }; + if (initial) { + run(initial, false); + } + var eventuallyRun = debounce(function () { + var paths = Object.keys(buffer); + if (paths.length === 0) { + return; + } + var data = paths.map(function (path) { return buffer[path]; }); + buffer = Object.create(null); + run(es.readArray(data), true); + }, 500); + input.on('data', function (f) { + buffer[f.path] = f; + if (state === 'idle') { + eventuallyRun(); + } + }); + return es.duplex(input, output); +} +exports.incremental = incremental; +function fixWin32DirectoryPermissions() { + if (!/win32/.test(process.platform)) { + return es.through(); + } + return es.mapSync(function (f) { + if (f.stat && f.stat.isDirectory && f.stat.isDirectory()) { + f.stat.mode = 16877; + } + return f; + }); +} +exports.fixWin32DirectoryPermissions = fixWin32DirectoryPermissions; +function setExecutableBit(pattern) { + var setBit = es.mapSync(function (f) { + f.stat.mode = 33261; + return f; + }); + if (!pattern) { + return setBit; + } + var input = es.through(); + var filter = _filter(pattern, { restore: true }); + var output = input + .pipe(filter) + .pipe(setBit) + .pipe(filter.restore); + return es.duplex(input, output); +} +exports.setExecutableBit = setExecutableBit; +function toFileUri(filePath) { + var match = filePath.match(/^([a-z])\:(.*)$/i); + if (match) { + filePath = '/' + match[1].toUpperCase() + ':' + match[2]; + } + return 'file://' + filePath.replace(/\\/g, '/'); +} +exports.toFileUri = toFileUri; +function skipDirectories() { + return es.mapSync(function (f) { + if (!f.isDirectory()) { + return f; + } + }); +} +exports.skipDirectories = skipDirectories; +function cleanNodeModule(name, excludes, includes) { + var toGlob = function (path) { return '**/node_modules/' + name + (path ? '/' + path : ''); }; + var negate = function (str) { return '!' + str; }; + var allFilter = _filter(toGlob('**'), { restore: true }); + var globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob))); + var input = es.through(); + var nodeModuleInput = input.pipe(allFilter); + var output = nodeModuleInput.pipe(_filter(globs)); + if (includes) { + var includeGlobs = includes.map(toGlob); + output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs))); + } + output = output.pipe(allFilter.restore); + return es.duplex(input, output); +} +exports.cleanNodeModule = cleanNodeModule; +function loadSourcemaps() { + var input = es.through(); + var output = input + .pipe(es.map(function (f, cb) { + if (f.sourceMap) { + cb(null, f); + return; + } + if (!f.contents) { + cb(new Error('empty file')); + return; + } + var contents = f.contents.toString('utf8'); + var reg = /\/\/# sourceMappingURL=(.*)$/g; + var lastMatch = null, match = null; + while (match = reg.exec(contents)) { + lastMatch = match; + } + if (!lastMatch) { + f.sourceMap = { + version: 3, + names: [], + mappings: '', + sources: [f.relative.replace(/\//g, '/')], + sourcesContent: [contents] + }; + cb(null, f); + return; + } + f.contents = new Buffer(contents.replace(/\/\/# sourceMappingURL=(.*)$/g, ''), 'utf8'); + fs.readFile(path.join(path.dirname(f.path), lastMatch[1]), 'utf8', function (err, contents) { + if (err) { + return cb(err); + } + f.sourceMap = JSON.parse(contents); + cb(null, f); + }); + })); + return es.duplex(input, output); +} +exports.loadSourcemaps = loadSourcemaps; +function stripSourceMappingURL() { + var input = es.through(); + var output = input + .pipe(es.mapSync(function (f) { + var contents = f.contents.toString('utf8'); + f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8'); + return f; + })); + return es.duplex(input, output); +} +exports.stripSourceMappingURL = stripSourceMappingURL; +function rimraf(dir) { + var retries = 0; + var retry = function (cb) { + _rimraf(dir, { maxBusyTries: 1 }, function (err) { + if (!err) { + return cb(); + } + ; + if (err.code === 'ENOTEMPTY' && ++retries < 5) { + return setTimeout(function () { return retry(cb); }, 10); + } + return cb(err); + }); + }; + return function (cb) { return retry(cb); }; +} +exports.rimraf = rimraf; +function getVersion(root) { + var version = process.env['BUILD_SOURCEVERSION']; + if (!version || !/^[0-9a-f]{40}$/i.test(version)) { + version = git.getVersion(root); + } + return version; +} +exports.getVersion = getVersion; +function rebase(count) { + return rename(function (f) { + var parts = f.dirname.split(/[\/\\]/); + f.dirname = parts.slice(count).join(path.sep); + }); +} +exports.rebase = rebase; +function filter(fn) { + var result = es.through(function (data) { + if (fn(data)) { + this.emit('data', data); + } + else { + result.restore.push(data); + } + }); + result.restore = es.through(); + return result; +} +exports.filter = filter; diff --git a/build/lib/util.ts b/build/lib/util.ts index 44cc657c0c0..8f4f1ea75e9 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -22,19 +22,19 @@ export interface ICancellationToken { isCancellationRequested(): boolean; } -const NoCancellationToken:ICancellationToken = { isCancellationRequested: () => false }; +const NoCancellationToken: ICancellationToken = { isCancellationRequested: () => false }; export interface IStreamProvider { - (cancellationToken?:ICancellationToken): NodeJS.ReadWriteStream; + (cancellationToken?: ICancellationToken): NodeJS.ReadWriteStream; } -export function incremental(streamProvider:IStreamProvider, initial:NodeJS.ReadWriteStream, supportsCancellation:boolean): NodeJS.ReadWriteStream { +export function incremental(streamProvider: IStreamProvider, initial: NodeJS.ReadWriteStream, supportsCancellation: boolean): NodeJS.ReadWriteStream { const input = es.through(); const output = es.through(); let state = 'idle'; let buffer = Object.create(null); - const token:ICancellationToken = !supportsCancellation ? null : { isCancellationRequested: () => Object.keys(buffer).length > 0 }; + const token: ICancellationToken = !supportsCancellation ? null : { isCancellationRequested: () => Object.keys(buffer).length > 0 }; const run = (input, isCancellable) => { state = 'running'; @@ -66,7 +66,7 @@ export function incremental(streamProvider:IStreamProvider, initial:NodeJS.ReadW run(es.readArray(data), true); }, 500); - input.on('data', f => { + input.on('data', (f: any) => { buffer[f.path] = f; if (state === 'idle') { @@ -82,7 +82,7 @@ export function fixWin32DirectoryPermissions(): NodeJS.ReadWriteStream { return es.through(); } - return es.mapSync(f => { + return es.mapSync(f => { if (f.stat && f.stat.isDirectory && f.stat.isDirectory()) { f.stat.mode = 16877; } @@ -92,7 +92,7 @@ export function fixWin32DirectoryPermissions(): NodeJS.ReadWriteStream { } export function setExecutableBit(pattern: string | string[]): NodeJS.ReadWriteStream { - var setBit = es.mapSync(f => { + var setBit = es.mapSync(f => { f.stat.mode = /* 100755 */ 33261; return f; }); @@ -111,7 +111,7 @@ export function setExecutableBit(pattern: string | string[]): NodeJS.ReadWriteSt return es.duplex(input, output); } -export function toFileUri(filePath:string): string { +export function toFileUri(filePath: string): string { const match = filePath.match(/^([a-z])\:(.*)$/i); if (match) { @@ -122,23 +122,23 @@ export function toFileUri(filePath:string): string { } export function skipDirectories(): NodeJS.ReadWriteStream { - return es.mapSync(f => { + return es.mapSync(f => { if (!f.isDirectory()) { return f; } }); } -export function cleanNodeModule(name:string, excludes:string[], includes:string[]): NodeJS.ReadWriteStream { - const toGlob = (path:string) => '**/node_modules/' + name + (path ? '/' + path : ''); - const negate = (str:string) => '!' + str; +export function cleanNodeModule(name: string, excludes: string[], includes: string[]): NodeJS.ReadWriteStream { + const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : ''); + const negate = (str: string) => '!' + str; const allFilter = _filter(toGlob('**'), { restore: true }); const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob))); const input = es.through(); const nodeModuleInput = input.pipe(allFilter); - let output:NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs)); + let output: NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs)); if (includes) { const includeGlobs = includes.map(toGlob); @@ -157,7 +157,7 @@ export function loadSourcemaps(): NodeJS.ReadWriteStream { const input = es.through(); const output = input - .pipe(es.map((f, cb): FileSourceMap => { + .pipe(es.map((f, cb): FileSourceMap => { if (f.sourceMap) { cb(null, f); return; @@ -207,7 +207,7 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream { const input = es.through(); const output = input - .pipe(es.mapSync(f => { + .pipe(es.mapSync(f => { const contents = (f.contents).toString('utf8'); f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8'); return f; @@ -216,11 +216,11 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream { return es.duplex(input, output); } -export function rimraf(dir:string):(cb:any)=>void { +export function rimraf(dir: string): (cb: any) => void { let retries = 0; const retry = cb => { - _rimraf(dir, { maxBusyTries: 1 }, (err:any) => { + _rimraf(dir, { maxBusyTries: 1 }, (err: any) => { if (!err) { return cb(); }; @@ -236,7 +236,7 @@ export function rimraf(dir:string):(cb:any)=>void { return cb => retry(cb); } -export function getVersion(root:string): string { +export function getVersion(root: string): string { let version = process.env['BUILD_SOURCEVERSION']; if (!version || !/^[0-9a-f]{40}$/i.test(version)) { @@ -246,7 +246,7 @@ export function getVersion(root:string): string { return version; } -export function rebase(count:number): NodeJS.ReadWriteStream { +export function rebase(count: number): NodeJS.ReadWriteStream { return rename(f => { const parts = f.dirname.split(/[\/\\]/); f.dirname = parts.slice(count).join(path.sep); @@ -257,7 +257,7 @@ export interface FilterStream extends NodeJS.ReadWriteStream { restore: ThroughStream; } -export function filter(fn:(data:any)=>boolean):FilterStream { +export function filter(fn: (data: any) => boolean): FilterStream { const result = es.through(function (data) { if (fn(data)) { this.emit('data', data); diff --git a/build/monaco/api.js b/build/monaco/api.js index 96d03bf8da6..83eacd16a3d 100644 --- a/build/monaco/api.js +++ b/build/monaco/api.js @@ -1,327 +1,327 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var fs = require("fs"); -var ts = require("typescript"); -var path = require("path"); -var tsfmt = require('../../tsfmt.json'); -var util = require('gulp-util'); -function log(message) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - util.log.apply(util, [util.colors.cyan('[monaco.d.ts]'), message].concat(rest)); -} -var SRC = path.join(__dirname, '../../src'); -var OUT_ROOT = path.join(__dirname, '../../'); -var RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe'); -var DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts'); -var CURRENT_PROCESSING_RULE = ''; -function logErr(message) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - util.log(util.colors.red('[monaco.d.ts]'), 'WHILE HANDLING RULE: ', CURRENT_PROCESSING_RULE); - util.log.apply(util, [util.colors.red('[monaco.d.ts]'), message].concat(rest)); -} -function moduleIdToPath(out, moduleId) { - if (/\.d\.ts/.test(moduleId)) { - return path.join(SRC, moduleId); - } - return path.join(OUT_ROOT, out, moduleId) + '.d.ts'; -} -var SOURCE_FILE_MAP = {}; -function getSourceFile(out, inputFiles, moduleId) { - if (!SOURCE_FILE_MAP[moduleId]) { - var filePath = path.normalize(moduleIdToPath(out, moduleId)); - if (!inputFiles.hasOwnProperty(filePath)) { - logErr('CANNOT FIND FILE ' + filePath + '. YOU MIGHT NEED TO RESTART gulp'); - return null; - } - var fileContents = inputFiles[filePath]; - var sourceFile = ts.createSourceFile(filePath, fileContents, ts.ScriptTarget.ES5); - SOURCE_FILE_MAP[moduleId] = sourceFile; - } - return SOURCE_FILE_MAP[moduleId]; -} -function isDeclaration(a) { - return (a.kind === ts.SyntaxKind.InterfaceDeclaration - || a.kind === ts.SyntaxKind.EnumDeclaration - || a.kind === ts.SyntaxKind.ClassDeclaration - || a.kind === ts.SyntaxKind.TypeAliasDeclaration - || a.kind === ts.SyntaxKind.FunctionDeclaration - || a.kind === ts.SyntaxKind.ModuleDeclaration); -} -function visitTopLevelDeclarations(sourceFile, visitor) { - var stop = false; - var visit = function (node) { - if (stop) { - return; - } - switch (node.kind) { - case ts.SyntaxKind.InterfaceDeclaration: - case ts.SyntaxKind.EnumDeclaration: - case ts.SyntaxKind.ClassDeclaration: - case ts.SyntaxKind.VariableStatement: - case ts.SyntaxKind.TypeAliasDeclaration: - case ts.SyntaxKind.FunctionDeclaration: - case ts.SyntaxKind.ModuleDeclaration: - stop = visitor(node); - } - // if (node.kind !== ts.SyntaxKind.SourceFile) { - // if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) { - // console.log('FOUND TEXT IN NODE: ' + ts.SyntaxKind[node.kind]); - // console.log(getNodeText(sourceFile, node)); - // } - // } - if (stop) { - return; - } - ts.forEachChild(node, visit); - }; - visit(sourceFile); -} -function getAllTopLevelDeclarations(sourceFile) { - var all = []; - visitTopLevelDeclarations(sourceFile, function (node) { - if (node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.ModuleDeclaration) { - var interfaceDeclaration = node; - var triviaStart = interfaceDeclaration.pos; - var triviaEnd = interfaceDeclaration.name.pos; - var triviaText = getNodeText(sourceFile, { pos: triviaStart, end: triviaEnd }); - // // let nodeText = getNodeText(sourceFile, node); - // if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) { - // console.log('TRIVIA: ', triviaText); - // } - if (triviaText.indexOf('@internal') === -1) { - all.push(node); - } - } - else { - var nodeText = getNodeText(sourceFile, node); - if (nodeText.indexOf('@internal') === -1) { - all.push(node); - } - } - return false /*continue*/; - }); - return all; -} -function getTopLevelDeclaration(sourceFile, typeName) { - var result = null; - visitTopLevelDeclarations(sourceFile, function (node) { - if (isDeclaration(node)) { - if (node.name.text === typeName) { - result = node; - return true /*stop*/; - } - return false /*continue*/; - } - // node is ts.VariableStatement - if (getNodeText(sourceFile, node).indexOf(typeName) >= 0) { - result = node; - return true /*stop*/; - } - return false /*continue*/; - }); - return result; -} -function getNodeText(sourceFile, node) { - return sourceFile.getFullText().substring(node.pos, node.end); -} -function getMassagedTopLevelDeclarationText(sourceFile, declaration) { - var result = getNodeText(sourceFile, declaration); - // if (result.indexOf('MonacoWorker') >= 0) { - // console.log('here!'); - // // console.log(ts.SyntaxKind[declaration.kind]); - // } - if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) { - var interfaceDeclaration = declaration; - var members = interfaceDeclaration.members; - members.forEach(function (member) { - try { - var memberText = getNodeText(sourceFile, member); - if (memberText.indexOf('@internal') >= 0 || memberText.indexOf('private') >= 0) { - // console.log('BEFORE: ', result); - result = result.replace(memberText, ''); - // console.log('AFTER: ', result); - } - } - catch (err) { - // life.. - } - }); - } - result = result.replace(/export default/g, 'export'); - result = result.replace(/export declare/g, 'export'); - return result; -} -function format(text) { - // Parse the source text - var sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true); - // Get the formatting edits on the input sources - var edits = ts.formatting.formatDocument(sourceFile, getRuleProvider(tsfmt), tsfmt); - // Apply the edits on the input code - return applyEdits(text, edits); - function getRuleProvider(options) { - // Share this between multiple formatters using the same options. - // This represents the bulk of the space the formatter uses. - var ruleProvider = new ts.formatting.RulesProvider(); - ruleProvider.ensureUpToDate(options); - return ruleProvider; - } - function applyEdits(text, edits) { - // Apply edits in reverse on the existing text - var result = text; - for (var i = edits.length - 1; i >= 0; i--) { - var change = edits[i]; - var head = result.slice(0, change.span.start); - var tail = result.slice(change.span.start + change.span.length); - result = head + change.newText + tail; - } - return result; - } -} -function createReplacer(data) { - data = data || ''; - var rawDirectives = data.split(';'); - var directives = []; - rawDirectives.forEach(function (rawDirective) { - if (rawDirective.length === 0) { - return; - } - var pieces = rawDirective.split('=>'); - var findStr = pieces[0]; - var replaceStr = pieces[1]; - findStr = findStr.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&'); - findStr = '\\b' + findStr + '\\b'; - directives.push([new RegExp(findStr, 'g'), replaceStr]); - }); - return function (str) { - for (var i = 0; i < directives.length; i++) { - str = str.replace(directives[i][0], directives[i][1]); - } - return str; - }; -} -function generateDeclarationFile(out, inputFiles, recipe) { - var lines = recipe.split(/\r\n|\n|\r/); - var result = []; - lines.forEach(function (line) { - var m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/); - if (m1) { - CURRENT_PROCESSING_RULE = line; - var moduleId = m1[1]; - var sourceFile_1 = getSourceFile(out, inputFiles, moduleId); - if (!sourceFile_1) { - return; - } - var replacer_1 = createReplacer(m1[2]); - var typeNames = m1[3].split(/,/); - typeNames.forEach(function (typeName) { - typeName = typeName.trim(); - if (typeName.length === 0) { - return; - } - var declaration = getTopLevelDeclaration(sourceFile_1, typeName); - if (!declaration) { - logErr('Cannot find type ' + typeName); - return; - } - result.push(replacer_1(getMassagedTopLevelDeclarationText(sourceFile_1, declaration))); - }); - return; - } - var m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/); - if (m2) { - CURRENT_PROCESSING_RULE = line; - var moduleId = m2[1]; - var sourceFile_2 = getSourceFile(out, inputFiles, moduleId); - if (!sourceFile_2) { - return; - } - var replacer_2 = createReplacer(m2[2]); - var typeNames = m2[3].split(/,/); - var typesToExcludeMap_1 = {}; - var typesToExcludeArr_1 = []; - typeNames.forEach(function (typeName) { - typeName = typeName.trim(); - if (typeName.length === 0) { - return; - } - typesToExcludeMap_1[typeName] = true; - typesToExcludeArr_1.push(typeName); - }); - getAllTopLevelDeclarations(sourceFile_2).forEach(function (declaration) { - if (isDeclaration(declaration)) { - if (typesToExcludeMap_1[declaration.name.text]) { - return; - } - } - else { - // node is ts.VariableStatement - var nodeText = getNodeText(sourceFile_2, declaration); - for (var i = 0; i < typesToExcludeArr_1.length; i++) { - if (nodeText.indexOf(typesToExcludeArr_1[i]) >= 0) { - return; - } - } - } - result.push(replacer_2(getMassagedTopLevelDeclarationText(sourceFile_2, declaration))); - }); - return; - } - result.push(line); - }); - var resultTxt = result.join('\n'); - resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri'); - resultTxt = resultTxt.replace(/\bEvent= 0) { + // console.log('FOUND TEXT IN NODE: ' + ts.SyntaxKind[node.kind]); + // console.log(getNodeText(sourceFile, node)); + // } + // } + if (stop) { + return; + } + ts.forEachChild(node, visit); + }; + visit(sourceFile); +} +function getAllTopLevelDeclarations(sourceFile) { + var all = []; + visitTopLevelDeclarations(sourceFile, function (node) { + if (node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.ModuleDeclaration) { + var interfaceDeclaration = node; + var triviaStart = interfaceDeclaration.pos; + var triviaEnd = interfaceDeclaration.name.pos; + var triviaText = getNodeText(sourceFile, { pos: triviaStart, end: triviaEnd }); + // // let nodeText = getNodeText(sourceFile, node); + // if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) { + // console.log('TRIVIA: ', triviaText); + // } + if (triviaText.indexOf('@internal') === -1) { + all.push(node); + } + } + else { + var nodeText = getNodeText(sourceFile, node); + if (nodeText.indexOf('@internal') === -1) { + all.push(node); + } + } + return false /*continue*/; + }); + return all; +} +function getTopLevelDeclaration(sourceFile, typeName) { + var result = null; + visitTopLevelDeclarations(sourceFile, function (node) { + if (isDeclaration(node)) { + if (node.name.text === typeName) { + result = node; + return true /*stop*/; + } + return false /*continue*/; + } + // node is ts.VariableStatement + if (getNodeText(sourceFile, node).indexOf(typeName) >= 0) { + result = node; + return true /*stop*/; + } + return false /*continue*/; + }); + return result; +} +function getNodeText(sourceFile, node) { + return sourceFile.getFullText().substring(node.pos, node.end); +} +function getMassagedTopLevelDeclarationText(sourceFile, declaration) { + var result = getNodeText(sourceFile, declaration); + // if (result.indexOf('MonacoWorker') >= 0) { + // console.log('here!'); + // // console.log(ts.SyntaxKind[declaration.kind]); + // } + if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) { + var interfaceDeclaration = declaration; + var members = interfaceDeclaration.members; + members.forEach(function (member) { + try { + var memberText = getNodeText(sourceFile, member); + if (memberText.indexOf('@internal') >= 0 || memberText.indexOf('private') >= 0) { + // console.log('BEFORE: ', result); + result = result.replace(memberText, ''); + // console.log('AFTER: ', result); + } + } + catch (err) { + // life.. + } + }); + } + result = result.replace(/export default/g, 'export'); + result = result.replace(/export declare/g, 'export'); + return result; +} +function format(text) { + // Parse the source text + var sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true); + // Get the formatting edits on the input sources + var edits = ts.formatting.formatDocument(sourceFile, getRuleProvider(tsfmt), tsfmt); + // Apply the edits on the input code + return applyEdits(text, edits); + function getRuleProvider(options) { + // Share this between multiple formatters using the same options. + // This represents the bulk of the space the formatter uses. + var ruleProvider = new ts.formatting.RulesProvider(); + ruleProvider.ensureUpToDate(options); + return ruleProvider; + } + function applyEdits(text, edits) { + // Apply edits in reverse on the existing text + var result = text; + for (var i = edits.length - 1; i >= 0; i--) { + var change = edits[i]; + var head = result.slice(0, change.span.start); + var tail = result.slice(change.span.start + change.span.length); + result = head + change.newText + tail; + } + return result; + } +} +function createReplacer(data) { + data = data || ''; + var rawDirectives = data.split(';'); + var directives = []; + rawDirectives.forEach(function (rawDirective) { + if (rawDirective.length === 0) { + return; + } + var pieces = rawDirective.split('=>'); + var findStr = pieces[0]; + var replaceStr = pieces[1]; + findStr = findStr.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&'); + findStr = '\\b' + findStr + '\\b'; + directives.push([new RegExp(findStr, 'g'), replaceStr]); + }); + return function (str) { + for (var i = 0; i < directives.length; i++) { + str = str.replace(directives[i][0], directives[i][1]); + } + return str; + }; +} +function generateDeclarationFile(out, inputFiles, recipe) { + var lines = recipe.split(/\r\n|\n|\r/); + var result = []; + lines.forEach(function (line) { + var m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/); + if (m1) { + CURRENT_PROCESSING_RULE = line; + var moduleId = m1[1]; + var sourceFile_1 = getSourceFile(out, inputFiles, moduleId); + if (!sourceFile_1) { + return; + } + var replacer_1 = createReplacer(m1[2]); + var typeNames = m1[3].split(/,/); + typeNames.forEach(function (typeName) { + typeName = typeName.trim(); + if (typeName.length === 0) { + return; + } + var declaration = getTopLevelDeclaration(sourceFile_1, typeName); + if (!declaration) { + logErr('Cannot find type ' + typeName); + return; + } + result.push(replacer_1(getMassagedTopLevelDeclarationText(sourceFile_1, declaration))); + }); + return; + } + var m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/); + if (m2) { + CURRENT_PROCESSING_RULE = line; + var moduleId = m2[1]; + var sourceFile_2 = getSourceFile(out, inputFiles, moduleId); + if (!sourceFile_2) { + return; + } + var replacer_2 = createReplacer(m2[2]); + var typeNames = m2[3].split(/,/); + var typesToExcludeMap_1 = {}; + var typesToExcludeArr_1 = []; + typeNames.forEach(function (typeName) { + typeName = typeName.trim(); + if (typeName.length === 0) { + return; + } + typesToExcludeMap_1[typeName] = true; + typesToExcludeArr_1.push(typeName); + }); + getAllTopLevelDeclarations(sourceFile_2).forEach(function (declaration) { + if (isDeclaration(declaration)) { + if (typesToExcludeMap_1[declaration.name.text]) { + return; + } + } + else { + // node is ts.VariableStatement + var nodeText = getNodeText(sourceFile_2, declaration); + for (var i = 0; i < typesToExcludeArr_1.length; i++) { + if (nodeText.indexOf(typesToExcludeArr_1[i]) >= 0) { + return; + } + } + } + result.push(replacer_2(getMassagedTopLevelDeclarationText(sourceFile_2, declaration))); + }); + return; + } + result.push(line); + }); + var resultTxt = result.join('\n'); + resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri'); + resultTxt = resultTxt.replace(/\bEvent