UNPKG

grunt-tsc

Version:

Compile typescript files via grunt tasks

920 lines (917 loc) 989 kB
/*! ***************************************************************************** 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. ***************************************************************************** */ var ts; (function (ts) { (function (EmitReturnStatus) { EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; EmitReturnStatus[EmitReturnStatus["JSGeneratedWithSemanticErrors"] = 2] = "JSGeneratedWithSemanticErrors"; EmitReturnStatus[EmitReturnStatus["DeclarationGenerationSkipped"] = 3] = "DeclarationGenerationSkipped"; EmitReturnStatus[EmitReturnStatus["EmitErrorsEncountered"] = 4] = "EmitErrorsEncountered"; EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); var EmitReturnStatus = ts.EmitReturnStatus; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; })(ts || (ts = {})); var ts; (function (ts) { function forEach(array, callback) { if (array) { for (var i = 0, len = array.length; i < len; i++) { var result = callback(array[i]); if (result) { return result; } } } return undefined; } ts.forEach = forEach; function contains(array, value) { if (array) { for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return true; } } } return false; } ts.contains = contains; function indexOf(array, value) { if (array) { for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return i; } } } return -1; } ts.indexOf = indexOf; function countWhere(array, predicate) { var count = 0; if (array) { for (var i = 0, len = array.length; i < len; i++) { if (predicate(array[i])) { count++; } } } return count; } ts.countWhere = countWhere; function filter(array, f) { if (array) { var result = []; for (var i = 0, len = array.length; i < len; i++) { var item = array[i]; if (f(item)) { result.push(item); } } } return result; } ts.filter = filter; function map(array, f) { if (array) { var result = []; for (var i = 0, len = array.length; i < len; i++) { result.push(f(array[i])); } } return result; } ts.map = map; function concatenate(array1, array2) { if (!array2 || !array2.length) return array1; if (!array1 || !array1.length) return array2; return array1.concat(array2); } ts.concatenate = concatenate; function deduplicate(array) { if (array) { var result = []; for (var i = 0, len = array.length; i < len; i++) { var item = array[i]; if (!contains(result, item)) result.push(item); } } return result; } ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; for (var i = 0; i < array.length; i++) { result += array[i][prop]; } return result; } ts.sum = sum; function lastOrUndefined(array) { if (array.length === 0) { return undefined; } return array[array.length - 1]; } ts.lastOrUndefined = lastOrUndefined; function binarySearch(array, value) { var low = 0; var high = array.length - 1; while (low <= high) { var middle = low + ((high - low) >> 1); var midValue = array[middle]; if (midValue === value) { return middle; } else if (midValue > value) { high = middle - 1; } else { low = middle + 1; } } return ~low; } ts.binarySearch = binarySearch; var hasOwnProperty = Object.prototype.hasOwnProperty; function hasProperty(map, key) { return hasOwnProperty.call(map, key); } ts.hasProperty = hasProperty; function getProperty(map, key) { return hasOwnProperty.call(map, key) ? map[key] : undefined; } ts.getProperty = getProperty; function isEmpty(map) { for (var id in map) { if (hasProperty(map, id)) { return false; } } return true; } ts.isEmpty = isEmpty; function clone(object) { var result = {}; for (var id in object) { result[id] = object[id]; } return result; } ts.clone = clone; function forEachValue(map, callback) { var result; for (var id in map) { if (result = callback(map[id])) break; } return result; } ts.forEachValue = forEachValue; function forEachKey(map, callback) { var result; for (var id in map) { if (result = callback(id)) break; } return result; } ts.forEachKey = forEachKey; function lookUp(map, key) { return hasProperty(map, key) ? map[key] : undefined; } ts.lookUp = lookUp; function mapToArray(map) { var result = []; for (var id in map) { result.push(map[id]); } return result; } ts.mapToArray = mapToArray; function arrayToMap(array, makeKey) { var result = {}; forEach(array, function (value) { result[makeKey(value)] = value; }); return result; } ts.arrayToMap = arrayToMap; function formatStringFromArgs(text, args, baseIndex) { baseIndex = baseIndex || 0; return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); } ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; } ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); var text = getLocaleSpecificMessage(message.key); if (arguments.length > 4) { text = formatStringFromArgs(text, arguments, 4); } return { file: file, start: start, length: length, messageText: text, category: message.category, code: message.code, isEarly: message.isEarly }; } ts.createFileDiagnostic = createFileDiagnostic; function createCompilerDiagnostic(message) { var text = getLocaleSpecificMessage(message.key); if (arguments.length > 1) { text = formatStringFromArgs(text, arguments, 1); } return { file: undefined, start: undefined, length: undefined, messageText: text, category: message.category, code: message.code, isEarly: message.isEarly }; } ts.createCompilerDiagnostic = createCompilerDiagnostic; function chainDiagnosticMessages(details, message) { var text = getLocaleSpecificMessage(message.key); if (arguments.length > 2) { text = formatStringFromArgs(text, arguments, 2); } return { messageText: text, category: message.category, code: message.code, next: details }; } ts.chainDiagnosticMessages = chainDiagnosticMessages; function concatenateDiagnosticMessageChains(headChain, tailChain) { Debug.assert(!headChain.next); headChain.next = tailChain; return headChain; } ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; function flattenDiagnosticChain(file, start, length, diagnosticChain, newLine) { Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); var code = diagnosticChain.code; var category = diagnosticChain.category; var messageText = ""; var indent = 0; while (diagnosticChain) { if (indent) { messageText += newLine; for (var i = 0; i < indent; i++) { messageText += " "; } } messageText += diagnosticChain.messageText; indent++; diagnosticChain = diagnosticChain.next; } return { file: file, start: start, length: length, code: code, category: category, messageText: messageText }; } ts.flattenDiagnosticChain = flattenDiagnosticChain; function compareValues(a, b) { if (a === b) return 0 /* EqualTo */; if (a === undefined) return -1 /* LessThan */; if (b === undefined) return 1 /* GreaterThan */; return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; } ts.compareValues = compareValues; function getDiagnosticFilename(diagnostic) { return diagnostic.file ? diagnostic.file.filename : undefined; } function compareDiagnostics(d1, d2) { return compareValues(getDiagnosticFilename(d1), getDiagnosticFilename(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareValues(d1.messageText, d2.messageText) || 0; } ts.compareDiagnostics = compareDiagnostics; function deduplicateSortedDiagnostics(diagnostics) { if (diagnostics.length < 2) { return diagnostics; } var newDiagnostics = [diagnostics[0]]; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; } } return newDiagnostics; } ts.deduplicateSortedDiagnostics = deduplicateSortedDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } ts.normalizeSlashes = normalizeSlashes; function getRootLength(path) { if (path.charCodeAt(0) === 47 /* slash */) { if (path.charCodeAt(1) !== 47 /* slash */) return 1; var p1 = path.indexOf("/", 2); if (p1 < 0) return 2; var p2 = path.indexOf("/", p1 + 1); if (p2 < 0) return p1 + 1; return p2 + 1; } if (path.charCodeAt(1) === 58 /* colon */) { if (path.charCodeAt(2) === 47 /* slash */) return 3; return 2; } return 0; } ts.getRootLength = getRootLength; ts.directorySeparator = "/"; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; for (var i = 0; i < parts.length; i++) { var part = parts[i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { normalized.pop(); } else { normalized.push(part); } } } return normalized; } function normalizePath(path) { var path = normalizeSlashes(path); var rootLength = getRootLength(path); var normalized = getNormalizedParts(path, rootLength); return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); } ts.normalizePath = normalizePath; function getDirectoryPath(path) { return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator))); } ts.getDirectoryPath = getDirectoryPath; function isUrl(path) { return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; } ts.isUrl = isUrl; function isRootedDiskPath(path) { return getRootLength(path) !== 0; } ts.isRootedDiskPath = isRootedDiskPath; function normalizedPathComponents(path, rootLength) { var normalizedParts = getNormalizedParts(path, rootLength); return [path.substr(0, rootLength)].concat(normalizedParts); } function getNormalizedPathComponents(path, currentDirectory) { var path = normalizeSlashes(path); var rootLength = getRootLength(path); if (rootLength == 0) { path = combinePaths(normalizeSlashes(currentDirectory), path); rootLength = getRootLength(path); } return normalizedPathComponents(path, rootLength); } ts.getNormalizedPathComponents = getNormalizedPathComponents; function getNormalizedAbsolutePath(filename, currentDirectory) { return getNormalizedPathFromPathComponents(getNormalizedPathComponents(filename, currentDirectory)); } ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; function getNormalizedPathFromPathComponents(pathComponents) { if (pathComponents && pathComponents.length) { return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); } } ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { var urlLength = url.length; var rootLength = url.indexOf("://") + "://".length; while (rootLength < urlLength) { if (url.charCodeAt(rootLength) === 47 /* slash */) { rootLength++; } else { break; } } if (rootLength === urlLength) { return [url]; } var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { rootLength = indexOfNextSlash + 1; return normalizedPathComponents(url, rootLength); } else { return [url + ts.directorySeparator]; } } function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { if (isUrl(pathOrUrl)) { return getNormalizedPathComponentsOfUrl(pathOrUrl); } else { return getNormalizedPathComponents(pathOrUrl, currentDirectory); } } function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { directoryComponents.length--; } for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } } if (joinStartIndex) { var relativePath = ""; var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { if (directoryComponents[joinStartIndex] !== "") { relativePath = relativePath + ".." + ts.directorySeparator; } } return relativePath + relativePathComponents.join(ts.directorySeparator); } var absolutePath = getNormalizedPathFromPathComponents(pathComponents); if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { absolutePath = "file:///" + absolutePath; } return absolutePath; } ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; function getBaseFilename(path) { var i = path.lastIndexOf(ts.directorySeparator); return i < 0 ? path : path.substring(i + 1); } ts.getBaseFilename = getBaseFilename; function combinePaths(path1, path2) { if (!(path1 && path1.length)) return path2; if (!(path2 && path2.length)) return path1; if (path2.charAt(0) === ts.directorySeparator) return path2; if (path1.charAt(path1.length - 1) === ts.directorySeparator) return path1 + path2; return path1 + ts.directorySeparator + path2; } ts.combinePaths = combinePaths; function fileExtensionIs(path, extension) { var pathLen = path.length; var extLen = extension.length; return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } ts.fileExtensionIs = fileExtensionIs; var supportedExtensions = [".d.ts", ".ts", ".js"]; function removeFileExtension(path) { for (var i = 0; i < supportedExtensions.length; i++) { var ext = supportedExtensions[i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); } } return path; } ts.removeFileExtension = removeFileExtension; var escapedCharsRegExp = /[\t\v\f\b\0\r\n\"\\\u2028\u2029\u0085]/g; var escapedCharsMap = { "\t": "\\t", "\v": "\\v", "\f": "\\f", "\b": "\\b", "\0": "\\0", "\r": "\\r", "\n": "\\n", "\"": "\\\"", "\u2028": "\\u2028", "\u2029": "\\u2029", "\u0085": "\\u0085" }; function escapeString(s) { return escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, function (c) { return escapedCharsMap[c] || c; }) : s; } ts.escapeString = escapeString; function Symbol(flags, name) { this.flags = flags; this.name = name; this.declarations = undefined; } function Type(checker, flags) { this.flags = flags; } function Signature(checker) { } ts.objectAllocator = { getNodeConstructor: function (kind) { function Node() { } Node.prototype = { kind: kind, pos: 0, end: 0, flags: 0, parent: undefined }; return Node; }, getSymbolConstructor: function () { return Symbol; }, getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } }; var Debug; (function (Debug) { var currentAssertionLevel = 0 /* None */; function shouldAssert(level) { return currentAssertionLevel >= level; } Debug.shouldAssert = shouldAssert; function assert(expression, message, verboseDebugInfo) { if (!expression) { var verboseDebugString = ""; if (verboseDebugInfo) { verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); } throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); } } Debug.assert = assert; function fail(message) { Debug.assert(false, message); } Debug.fail = fail; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); var ts; (function (ts) { ts.sys = (function () { function getWScriptSystem() { var fso = new ActiveXObject("Scripting.FileSystemObject"); var fileStream = new ActiveXObject("ADODB.Stream"); fileStream.Type = 2; var binaryStream = new ActiveXObject("ADODB.Stream"); binaryStream.Type = 1; var args = []; for (var i = 0; i < WScript.Arguments.length; i++) { args[i] = WScript.Arguments.Item(i); } function readFile(fileName, encoding) { if (!fso.FileExists(fileName)) { return undefined; } fileStream.Open(); try { if (encoding) { fileStream.Charset = encoding; fileStream.LoadFromFile(fileName); } else { fileStream.Charset = "x-ansi"; fileStream.LoadFromFile(fileName); var bom = fileStream.ReadText(2) || ""; fileStream.Position = 0; fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; } return fileStream.ReadText(); } catch (e) { throw e; } finally { fileStream.Close(); } } function writeFile(fileName, data, writeByteOrderMark) { fileStream.Open(); binaryStream.Open(); try { fileStream.Charset = "utf-8"; fileStream.WriteText(data); if (writeByteOrderMark) { fileStream.Position = 0; } else { fileStream.Position = 3; } fileStream.CopyTo(binaryStream); binaryStream.SaveToFile(fileName, 2); } finally { binaryStream.Close(); fileStream.Close(); } } return { args: args, newLine: "\r\n", useCaseSensitiveFileNames: false, write: function (s) { WScript.StdOut.Write(s); }, readFile: readFile, writeFile: writeFile, resolvePath: function (path) { return fso.GetAbsolutePathName(path); }, fileExists: function (path) { return fso.FileExists(path); }, directoryExists: function (path) { return fso.FolderExists(path); }, createDirectory: function (directoryName) { if (!this.directoryExists(directoryName)) { fso.CreateFolder(directoryName); } }, getExecutingFilePath: function () { return WScript.ScriptFullName; }, getCurrentDirectory: function () { return new ActiveXObject("WScript.Shell").CurrentDirectory; }, exit: function (exitCode) { try { WScript.Quit(exitCode); } catch (e) { } } }; } function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); var _os = require('os'); var platform = _os.platform(); var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; function readFile(fileName, encoding) { if (!_fs.existsSync(fileName)) { return undefined; } var buffer = _fs.readFileSync(fileName); var len = buffer.length; if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { len &= ~1; for (var i = 0; i < len; i += 2) { var temp = buffer[i]; buffer[i] = buffer[i + 1]; buffer[i + 1] = temp; } return buffer.toString("utf16le", 2); } if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) { return buffer.toString("utf16le", 2); } if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { return buffer.toString("utf8", 3); } return buffer.toString("utf8"); } function writeFile(fileName, data, writeByteOrderMark) { if (writeByteOrderMark) { data = '\uFEFF' + data; } _fs.writeFileSync(fileName, data, "utf8"); } return { args: process.argv.slice(2), newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, write: function (s) { _fs.writeSync(1, s); }, readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); return { close: function () { _fs.unwatchFile(fileName, fileChanged); } }; function fileChanged(curr, prev) { if (+curr.mtime <= +prev.mtime) { return; } callback(fileName); } ; }, resolvePath: function (path) { return _path.resolve(path); }, fileExists: function (path) { return _fs.existsSync(path); }, directoryExists: function (path) { return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); }, createDirectory: function (directoryName) { if (!this.directoryExists(directoryName)) { _fs.mkdirSync(directoryName); } }, getExecutingFilePath: function () { return __filename; }, getCurrentDirectory: function () { return process.cwd(); }, getMemoryUsage: function () { if (global.gc) { global.gc(); } return process.memoryUsage().heapUsed; }, exit: function (exitCode) { process.exit(exitCode); } }; } if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { return getWScriptSystem(); } else if (typeof module !== "undefined" && module.exports) { return getNodeSystem(); } else { return undefined; } })(); })(ts || (ts = {})); var ts; (function (ts) { ts.Diagnostics = { Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, or_expected: { code: 1144, category: 1 /* Error */, key: "'{' or ';' expected." }, Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." }, var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, Unterminated_template_literal: { code: 1160, category: 1 /* Error */, key: "Unterminated template literal." }, Unterminated_regular_expression_literal: { code: 1161, category: 1 /* Error */, key: "Unterminated regular expression literal." }, An_object_member_cannot_be_declared_optional: { code: 1162, category: 1 /* Error */, key: "An object member cannot be declared optional." }, yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: 1 /* Error */, key: "'yield' expression must be contained_within a generator declaration." }, Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: 1 /* Error */, key: "Computed property names are not allowed in enums." }, Computed_property_names_are_not_allowed_in_an_ambient_context: { code: 1165, category: 1 /* Error */, key: "Computed property names are not allowed in an ambient context." }, Computed_property_names_are_not_allowed_in_class_property_declarations: { code: 1166, category: 1 /* Error */, key: "Computed property names are not allowed in class property declarations." }, Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: 1 /* Error */, key: "Computed property names are only available when target