Skip to content

Commit 6eb3584

Browse files
committed
Reduce duplication
1 parent ea69ed3 commit 6eb3584

File tree

1 file changed

+8
-46
lines changed

1 file changed

+8
-46
lines changed

src/TypeScriptInstance.ts

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// tslint:disable-next-line:no-implicit-dependencies
12
import * as ts from 'typescript';
23

34
// TODO: keep in sync with TypeScript
@@ -17,51 +18,12 @@ export enum ScriptKind {
1718
}
1819

1920
export interface TypeScriptInstance {
20-
parseJsonConfigFileContent(
21-
json: any,
22-
host: ts.ParseConfigHost,
23-
basePath: string,
24-
existingOptions?: ts.CompilerOptions,
25-
configFileName?: string,
26-
resolutionStack?: ts.Path[],
27-
extraFileExtensions?: ReadonlyArray<ts.FileExtensionInfo>
28-
): ts.ParsedCommandLine;
29-
readConfigFile(
30-
fileName: string,
31-
readFile: (path: string) => string | undefined
32-
): {
33-
config?: any;
34-
error?: ts.Diagnostic;
35-
};
36-
createCompilerHost(
37-
options: ts.CompilerOptions,
38-
setParentNodes?: boolean
39-
): ts.CompilerHost;
40-
createProgram(
41-
rootNames: ReadonlyArray<string>,
42-
options: ts.CompilerOptions,
43-
host?: ts.CompilerHost,
44-
oldProgram?: ts.Program,
45-
configFileParsingDiagnostics?: ReadonlyArray<ts.Diagnostic>
46-
): ts.Program;
47-
flattenDiagnosticMessageText(
48-
messageText: string | ts.DiagnosticMessageChain | undefined,
49-
newLine: string
50-
): string;
51-
resolveModuleName(
52-
moduleName: string,
53-
containingFile: string,
54-
compilerOptions: ts.CompilerOptions,
55-
host: ts.ModuleResolutionHost,
56-
cache?: ts.ModuleResolutionCache
57-
): ts.ResolvedModuleWithFailedLookupLocations;
58-
createSourceFile(
59-
fileName: string,
60-
sourceText: string,
61-
languageVersion: ts.ScriptTarget,
62-
setParentNodes?: boolean,
63-
scriptKind?: ts.ScriptKind
64-
): ts.SourceFile;
65-
21+
parseJsonConfigFileContent: typeof ts.parseJsonConfigFileContent;
22+
readConfigFile: typeof ts.readConfigFile;
23+
createCompilerHost: typeof ts.createCompilerHost;
24+
createProgram: typeof ts.createProgram;
25+
flattenDiagnosticMessageText: typeof ts.flattenDiagnosticMessageText;
26+
resolveModuleName: typeof ts.resolveModuleName;
27+
createSourceFile: typeof ts.createSourceFile;
6628
sys: ts.System;
6729
}

0 commit comments

Comments
 (0)