1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type { Config } from '@jest/types';
|
8 | import type { Options, ReducedTransformOptions, RequireAndTranspileModuleOptions, StringMap, TransformResult } from './types';
|
9 | declare class ScriptTransformer {
|
10 | private readonly _config;
|
11 | private readonly _cacheFS;
|
12 | private readonly _cache;
|
13 | private readonly _transformCache;
|
14 | private _transformsAreLoaded;
|
15 | constructor(_config: Config.ProjectConfig, _cacheFS: StringMap);
|
16 | private _buildCacheKeyFromFileInfo;
|
17 | private _getCacheKey;
|
18 | private _getCacheKeyAsync;
|
19 | private _createFolderFromCacheKey;
|
20 | private _getFileCachePath;
|
21 | private _getFileCachePathAsync;
|
22 | private _getTransformPath;
|
23 | loadTransformers(): Promise<void>;
|
24 | private _getTransformer;
|
25 | private _instrumentFile;
|
26 | private _buildTransformResult;
|
27 | transformSource(filepath: Config.Path, content: string, options: ReducedTransformOptions): TransformResult;
|
28 | transformSourceAsync(filepath: Config.Path, content: string, options: ReducedTransformOptions): Promise<TransformResult>;
|
29 | private _transformAndBuildScriptAsync;
|
30 | private _transformAndBuildScript;
|
31 | transformAsync(filename: Config.Path, options: Options, fileSource?: string): Promise<TransformResult>;
|
32 | transform(filename: Config.Path, options: Options, fileSource?: string): TransformResult;
|
33 | transformJson(filename: Config.Path, options: Options, fileSource: string): string;
|
34 | requireAndTranspileModule<ModuleType = unknown>(moduleName: string, callback?: (module: ModuleType) => void | Promise<void>, options?: RequireAndTranspileModuleOptions): Promise<ModuleType>;
|
35 | shouldTransform(filename: Config.Path): boolean;
|
36 | }
|
37 | export declare function createTranspilingRequire(config: Config.ProjectConfig): Promise<(<TModuleType = unknown>(resolverPath: string, applyInteropRequireDefault?: boolean) => Promise<TModuleType>)>;
|
38 | export declare type TransformerType = ScriptTransformer;
|
39 | export declare function createScriptTransformer(config: Config.ProjectConfig, cacheFS?: StringMap): Promise<TransformerType>;
|
40 | export {};
|