diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index a9fe9a32556..f5e20f96480 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2407,6 +2407,14 @@ declare namespace ts { fileExists(path: string): boolean; readFile(path: string): string | undefined; } + /** + * Branded string for keeping track of when we've turned an ambiguous path + * specified like "./blah" to an absolute path to an actual + * tsconfig file, e.g. "/root/blah/tsconfig.json" + */ + type ResolvedConfigFileName = string & { + _isResolvedConfigFileName: never; + }; type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError: ((message: string) => void) | undefined, sourceFiles?: ReadonlyArray) => void; class OperationCanceledException { } @@ -3965,6 +3973,14 @@ declare namespace ts { tab = 9, verticalTab = 11 } + interface UpToDateHost { + fileExists(fileName: string): boolean; + getModifiedTime(fileName: string): Date; + getUnchangedTime?(fileName: string): Date | undefined; + getLastStatus?(fileName: string): UpToDateStatus | undefined; + setLastStatus?(fileName: string, status: UpToDateStatus): void; + parseConfigFile?(configFilePath: ResolvedConfigFileName): ParsedCommandLine | undefined; + } interface ModuleResolutionHost { fileExists(fileName: string): boolean; readFile(fileName: string): string | undefined; @@ -8923,7 +8939,7 @@ declare namespace ts { /** * Returns the target config filename of a project reference */ - function resolveProjectReferencePath(host: CompilerHost, ref: ProjectReference): string | undefined; + function resolveProjectReferencePath(host: CompilerHost | UpToDateHost, ref: ProjectReference): ResolvedConfigFileName; /** * Returns a DiagnosticMessage if we won't include a resolved module due to its extension. * The DiagnosticMessage's parameters are the imported module name, and the filename it resolved to. @@ -9405,14 +9421,6 @@ declare namespace ts { function createWatchProgram(host: WatchCompilerHostOfConfigFile): WatchOfConfigFile; } declare namespace ts { - /** - * Branded string for keeping track of when we've turned an ambiguous path - * specified like "./blah" to an absolute path to an actual - * tsconfig file, e.g. "/root/blah/tsconfig.json" - */ - type ResolvedConfigFileName = string & { - _isResolvedConfigFileName: never; - }; interface BuildHost { verbose(diag: DiagnosticMessage, ...args: string[]): void; error(diag: DiagnosticMessage, ...args: string[]): void; @@ -9579,6 +9587,12 @@ declare namespace ts { resolveProjectName: (name: string) => ResolvedConfigFileName | undefined; startWatching: () => void; }; + /** + * Gets the UpToDateStatus for a project + */ + function getUpToDateStatus(host: UpToDateHost, project: ParsedCommandLine | undefined): UpToDateStatus; + function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray; + function formatUpToDateStatus(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined; } //# sourceMappingURL=compiler.d.ts.map declare namespace ts.server { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 8bb1efe058b..62413b0753b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1716,6 +1716,14 @@ declare namespace ts { fileExists(path: string): boolean; readFile(path: string): string | undefined; } + /** + * Branded string for keeping track of when we've turned an ambiguous path + * specified like "./blah" to an absolute path to an actual + * tsconfig file, e.g. "/root/blah/tsconfig.json" + */ + type ResolvedConfigFileName = string & { + _isResolvedConfigFileName: never; + }; type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError: ((message: string) => void) | undefined, sourceFiles?: ReadonlyArray) => void; class OperationCanceledException { } @@ -2572,6 +2580,14 @@ declare namespace ts { oldProgram?: Program; configFileParsingDiagnostics?: ReadonlyArray; } + interface UpToDateHost { + fileExists(fileName: string): boolean; + getModifiedTime(fileName: string): Date; + getUnchangedTime?(fileName: string): Date | undefined; + getLastStatus?(fileName: string): UpToDateStatus | undefined; + setLastStatus?(fileName: string, status: UpToDateStatus): void; + parseConfigFile?(configFilePath: ResolvedConfigFileName): ParsedCommandLine | undefined; + } interface ModuleResolutionHost { fileExists(fileName: string): boolean; readFile(fileName: string): string | undefined; @@ -4142,7 +4158,7 @@ declare namespace ts { /** * Returns the target config filename of a project reference */ - function resolveProjectReferencePath(host: CompilerHost, ref: ProjectReference): string | undefined; + function resolveProjectReferencePath(host: CompilerHost | UpToDateHost, ref: ProjectReference): ResolvedConfigFileName; } declare namespace ts { interface EmitOutput { @@ -4388,14 +4404,6 @@ declare namespace ts { function createWatchProgram(host: WatchCompilerHostOfConfigFile): WatchOfConfigFile; } declare namespace ts { - /** - * Branded string for keeping track of when we've turned an ambiguous path - * specified like "./blah" to an absolute path to an actual - * tsconfig file, e.g. "/root/blah/tsconfig.json" - */ - type ResolvedConfigFileName = string & { - _isResolvedConfigFileName: never; - }; interface BuildHost { verbose(diag: DiagnosticMessage, ...args: string[]): void; error(diag: DiagnosticMessage, ...args: string[]): void; @@ -4562,6 +4570,12 @@ declare namespace ts { resolveProjectName: (name: string) => ResolvedConfigFileName | undefined; startWatching: () => void; }; + /** + * Gets the UpToDateStatus for a project + */ + function getUpToDateStatus(host: UpToDateHost, project: ParsedCommandLine | undefined): UpToDateStatus; + function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray; + function formatUpToDateStatus(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined; } declare namespace ts { interface Node {