Remove ts.{Map,Set,ESMap,Iterator} and associated types (#51439)

This commit is contained in:
Jake Bailey
2022-11-09 15:06:31 -08:00
committed by GitHub
parent d798493647
commit 9f64a3a58c
147 changed files with 1204 additions and 1470 deletions
+8 -8
View File
@@ -8,11 +8,11 @@ import {
createSolutionBuilderWithWatchHost, createWatchCompilerHostOfConfigFile,
createWatchCompilerHostOfFilesAndCompilerOptions, createWatchProgram, Debug, Diagnostic, DiagnosticMessage,
DiagnosticReporter, Diagnostics, dumpTracingLegend, EmitAndSemanticDiagnosticsBuilderProgram,
emitFilesAndReportErrorsAndGetExitStatus, ESMap, ExitStatus, ExtendedConfigCacheEntry, Extension, fileExtensionIs,
emitFilesAndReportErrorsAndGetExitStatus, ExitStatus, ExtendedConfigCacheEntry, Extension, fileExtensionIs,
fileExtensionIsOneOf, filter, findConfigFile, forEach, formatMessage, generateTSConfig,
getBuildOrderFromAnyBuildOrder, getCompilerOptionsDiffValue, getConfigFileParsingDiagnostics, getDiagnosticText,
getEntries, getErrorSummaryText, getLineStarts, getNormalizedAbsolutePath, isIncrementalCompilation, isWatchSet,
Map, normalizePath, optionDeclarations, optionsForBuild, optionsForWatch, padLeft, padRight, parseBuildCommand,
normalizePath, optionDeclarations, optionsForBuild, optionsForWatch, padLeft, padRight, parseBuildCommand,
parseCommandLine, parseConfigFileWithSystem, ParsedCommandLine, Program, reduceLeftIterator, ReportEmitErrorSummary,
SolutionBuilder, SolutionBuilderHostBase, sort, SourceFile, startsWith, startTracing, stringContains,
supportedJSExtensionsFlat, supportedTSExtensionsFlat, sys, System, toPath, tracing, validateLocaleAndSetLanguage,
@@ -32,7 +32,7 @@ export enum StatisticType {
memory,
}
function countLines(program: Program): Map<number> {
function countLines(program: Program): Map<string, number> {
const counts = getCountsMap();
forEach(program.getSourceFiles(), file => {
const key = getCountKey(program, file);
@@ -278,13 +278,13 @@ function generateOptionOutput(sys: System, option: CommandLineOption, rightAlign
}
function getValueCandidate(option: CommandLineOption): ValueCandidate | undefined {
// option.type might be "string" | "number" | "boolean" | "object" | "list" | ESMap<string, number | string>
// option.type might be "string" | "number" | "boolean" | "object" | "list" | Map<string, number | string>
// string -- any of: string
// number -- any of: number
// boolean -- any of: boolean
// object -- null
// list -- one or more: , content depends on `option.element.type`, the same as others
// ESMap<string, number | string> -- any of: key1, key2, ....
// Map<string, number | string> -- any of: key1, key2, ....
if (option.type === "object") {
return undefined;
}
@@ -323,7 +323,7 @@ function generateOptionOutput(sys: System, option: CommandLineOption, rightAlign
possibleValues = "";
break;
default:
// ESMap<string, number | string>
// Map<string, number | string>
// Group synonyms: es6/es2015
const inverted: { [value: string]: string[] } = {};
option.type.forEach((value, name) => {
@@ -924,7 +924,7 @@ function createWatchOfConfigFile(
configParseResult: ParsedCommandLine,
optionsToExtend: CompilerOptions,
watchOptionsToExtend: WatchOptions | undefined,
extendedConfigCache: Map<ExtendedConfigCacheEntry>,
extendedConfigCache: Map<string, ExtendedConfigCacheEntry>,
) {
const watchCompilerHost = createWatchCompilerHostOfConfigFile({
configFileName: configParseResult.options.configFilePath!,
@@ -974,7 +974,7 @@ function enableSolutionPerformance(system: System, options: BuildOptions) {
}
function createSolutionPerfomrance(): SolutionPerformance {
let statistics: ESMap<string, Statistic> | undefined;
let statistics: Map<string, Statistic> | undefined;
return {
addAggregateStatistic,
forEachAggregateStatistics: forEachAggreateStatistics,