mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
Make changes to public API
This commit is contained in:
@@ -1345,7 +1345,7 @@ namespace ts {
|
||||
configFileName: string,
|
||||
optionsToExtend: CompilerOptions,
|
||||
host: ParseConfigFileHost,
|
||||
/*@internal*/ extendedConfigCache?: Map<ExtendedConfigCacheEntry>
|
||||
extendedConfigCache?: Map<ExtendedConfigCacheEntry>
|
||||
): ParsedCommandLine | undefined {
|
||||
let configFileText: string | undefined;
|
||||
try {
|
||||
@@ -2183,7 +2183,7 @@ namespace ts {
|
||||
return existingErrors !== configParseDiagnostics.length;
|
||||
}
|
||||
|
||||
interface ParsedTsconfig {
|
||||
export interface ParsedTsconfig {
|
||||
raw: any;
|
||||
options?: CompilerOptions;
|
||||
typeAcquisition?: TypeAcquisition;
|
||||
@@ -2370,7 +2370,6 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export interface ExtendedConfigCacheEntry {
|
||||
extendedResult: TsConfigSourceFile;
|
||||
extendedConfig: ParsedTsconfig | undefined;
|
||||
@@ -2398,7 +2397,6 @@ namespace ts {
|
||||
const extendedDirname = getDirectoryPath(extendedConfigPath);
|
||||
extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname,
|
||||
getBaseFileName(extendedConfigPath), resolutionStack, errors, extendedConfigCache);
|
||||
|
||||
|
||||
if (isSuccessfulParsedTsconfig(extendedConfig)) {
|
||||
// Update the paths to reflect base path
|
||||
@@ -2423,7 +2421,7 @@ namespace ts {
|
||||
if (sourceFile) {
|
||||
sourceFile.extendedSourceFiles = [extendedResult.fileName];
|
||||
if (extendedResult.extendedSourceFiles) {
|
||||
sourceFile.extendedSourceFiles!.push(...extendedResult.extendedSourceFiles);
|
||||
sourceFile.extendedSourceFiles.push(...extendedResult.extendedSourceFiles);
|
||||
}
|
||||
}
|
||||
if (extendedResult.parseDiagnostics.length) {
|
||||
|
||||
@@ -2682,10 +2682,12 @@ namespace ts {
|
||||
if (host.getParsedCommandLine) {
|
||||
commandLine = host.getParsedCommandLine(refPath);
|
||||
if (!commandLine) {
|
||||
addFileToFilesByName(/*sourceFile*/ undefined, sourceFilePath, /*redirectedPath*/ undefined);
|
||||
projectReferenceRedirects.set(sourceFilePath, false);
|
||||
return undefined;
|
||||
}
|
||||
sourceFile = Debug.assertDefined(commandLine.options.configFile);
|
||||
addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined);
|
||||
}
|
||||
else {
|
||||
// An absolute path pointing to the containing directory of the config file
|
||||
|
||||
@@ -5130,7 +5130,7 @@ namespace ts {
|
||||
/* @internal */ hasInvalidatedResolution?: HasInvalidatedResolution;
|
||||
/* @internal */ hasChangedAutomaticTypeDirectiveNames?: boolean;
|
||||
createHash?(data: string): string;
|
||||
/*@internal*/getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
||||
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
||||
|
||||
// TODO: later handle this in better way in builder host instead once the api for tsbuild finalizes and doesnt use compilerHost as base
|
||||
/*@internal*/createDirectory?(directory: string): void;
|
||||
|
||||
@@ -2760,6 +2760,7 @@ declare namespace ts {
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
getEnvironmentVariable?(name: string): string | undefined;
|
||||
createHash?(data: string): string;
|
||||
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
||||
}
|
||||
interface SourceMapRange extends TextRange {
|
||||
source?: SourceMapSource;
|
||||
@@ -3631,7 +3632,7 @@ declare namespace ts {
|
||||
/**
|
||||
* Reads the config file, reports errors if any and exits if the config file cannot be found
|
||||
*/
|
||||
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost): ParsedCommandLine | undefined;
|
||||
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map<ExtendedConfigCacheEntry>): ParsedCommandLine | undefined;
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
@@ -3673,7 +3674,20 @@ declare namespace ts {
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
|
||||
function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>, /*@internal*/ extendedConfigCache?: Map<ExtendedConfigCacheEntry>): ParsedCommandLine;
|
||||
interface ParsedTsconfig {
|
||||
raw: any;
|
||||
options?: CompilerOptions;
|
||||
typeAcquisition?: TypeAcquisition;
|
||||
/**
|
||||
* Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet
|
||||
*/
|
||||
extendedConfigPath?: string;
|
||||
}
|
||||
interface ExtendedConfigCacheEntry {
|
||||
extendedResult: TsConfigSourceFile;
|
||||
extendedConfig: ParsedTsconfig | undefined;
|
||||
}
|
||||
function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
|
||||
options: CompilerOptions;
|
||||
errors: Diagnostic[];
|
||||
|
||||
18
tests/baselines/reference/api/typescript.d.ts
vendored
18
tests/baselines/reference/api/typescript.d.ts
vendored
@@ -2760,6 +2760,7 @@ declare namespace ts {
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
getEnvironmentVariable?(name: string): string | undefined;
|
||||
createHash?(data: string): string;
|
||||
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
||||
}
|
||||
interface SourceMapRange extends TextRange {
|
||||
source?: SourceMapSource;
|
||||
@@ -3631,7 +3632,7 @@ declare namespace ts {
|
||||
/**
|
||||
* Reads the config file, reports errors if any and exits if the config file cannot be found
|
||||
*/
|
||||
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost): ParsedCommandLine | undefined;
|
||||
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map<ExtendedConfigCacheEntry>): ParsedCommandLine | undefined;
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
@@ -3673,7 +3674,20 @@ declare namespace ts {
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine;
|
||||
function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>, /*@internal*/ extendedConfigCache?: Map<ExtendedConfigCacheEntry>): ParsedCommandLine;
|
||||
interface ParsedTsconfig {
|
||||
raw: any;
|
||||
options?: CompilerOptions;
|
||||
typeAcquisition?: TypeAcquisition;
|
||||
/**
|
||||
* Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet
|
||||
*/
|
||||
extendedConfigPath?: string;
|
||||
}
|
||||
interface ExtendedConfigCacheEntry {
|
||||
extendedResult: TsConfigSourceFile;
|
||||
extendedConfig: ParsedTsconfig | undefined;
|
||||
}
|
||||
function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): {
|
||||
options: CompilerOptions;
|
||||
errors: Diagnostic[];
|
||||
|
||||
Reference in New Issue
Block a user