UNPKG

1.36 kBTypeScriptView Raw
1import { Logger } from 'bs-logger';
2import type { CompilerOptions, CustomTransformers, Program, TranspileOutput } from 'typescript';
3import type { StringMap, TsCompilerInstance, TsJestAstTransformer, TsJestCompileOptions, TTypeScript } from '../../types';
4import { CompiledOutput } from '../../types';
5import type { ConfigSet } from '../config/config-set';
6export declare class TsCompiler implements TsCompilerInstance {
7 readonly configSet: ConfigSet;
8 readonly runtimeCacheFS: StringMap;
9 protected readonly _logger: Logger;
10 protected readonly _ts: TTypeScript;
11 protected readonly _initialCompilerOptions: CompilerOptions;
12 protected _compilerOptions: CompilerOptions;
13 /**
14 * @private
15 */
16 private _runtimeCacheFS;
17 /**
18 * @private
19 */
20 private _fileContentCache;
21 program: Program | undefined;
22 constructor(configSet: ConfigSet, runtimeCacheFS: StringMap);
23 getResolvedModules(fileContent: string, fileName: string, runtimeCacheFS: StringMap): string[];
24 private fixupCompilerOptionsForModuleKind;
25 getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions): CompiledOutput;
26 protected _transpileOutput(fileContent: string, fileName: string): TranspileOutput;
27 protected _makeTransformers(customTransformers: TsJestAstTransformer): CustomTransformers;
28}