Skip to content

Commit ec6c9ea

Browse files
committed
Start shaping SolutionBuilder API
1 parent 324073a commit ec6c9ea

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/compiler/tsbuild.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,22 @@ namespace ts {
335335
export interface SolutionBuilderWithWatchHost extends SolutionBuilderHost, WatchHost {
336336
}
337337

338+
export interface SolutionBuilder {
339+
buildAllProjects(): ExitStatus;
340+
cleanAllProjects(): ExitStatus;
341+
342+
/*@internal*/ resolveProjectName(name: string): ResolvedConfigFileName;
343+
/*@internal*/ getUpToDateStatusOfFile(configFileName: ResolvedConfigFileName): UpToDateStatus;
344+
/*@internal*/ getBuildGraph(configFileNames: ReadonlyArray<string>): DependencyGraph | undefined;
345+
346+
/*@internal*/ invalidateProject(configFileName: string, reloadLevel?: ConfigFileProgramReloadLevel): void;
347+
/*@internal*/ buildInvalidatedProject(): void;
348+
349+
/*@internal*/ resetBuildContext(opts?: BuildOptions): void;
350+
351+
/*@internal*/ startWatching(): void;
352+
}
353+
338354
/**
339355
* Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
340356
*/
@@ -373,7 +389,7 @@ namespace ts {
373389
* TODO: use SolutionBuilderWithWatchHost => watchedSolution
374390
* use SolutionBuilderHost => Solution
375391
*/
376-
export function createSolutionBuilder(host: SolutionBuilderHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions) {
392+
export function createSolutionBuilder(host: SolutionBuilderHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions): SolutionBuilder {
377393
const hostWithWatch = host as SolutionBuilderWithWatchHost;
378394
const currentDirectory = host.getCurrentDirectory();
379395
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
@@ -405,7 +421,6 @@ namespace ts {
405421

406422
return {
407423
buildAllProjects,
408-
getUpToDateStatus,
409424
getUpToDateStatusOfFile,
410425
cleanAllProjects,
411426
resetBuildContext,

0 commit comments

Comments
 (0)