1 | import ts, { CompilerOptions, EmitHost, Pattern, SourceFile } from "typescript";
|
2 | import { PluginConfig } from "ts-patch";
|
3 | import { HarmonyFactory } from "./harmony";
|
4 | import { IMinimatch } from "minimatch";
|
5 | export declare type ImportOrExportDeclaration = ts.ImportDeclaration | ts.ExportDeclaration;
|
6 | export declare type ImportOrExportClause = ts.ImportDeclaration["importClause"] | ts.ExportDeclaration["exportClause"];
|
7 | export interface TsTransformPathsConfig extends PluginConfig {
|
8 | readonly useRootDirs?: boolean;
|
9 | readonly exclude?: string[];
|
10 | }
|
11 | export interface TsTransformPathsContext {
|
12 | |
13 |
|
14 |
|
15 | readonly tsInstance: typeof ts;
|
16 | readonly tsVersionMajor: number;
|
17 | readonly tsVersionMinor: number;
|
18 | readonly tsFactory?: ts.NodeFactory;
|
19 | readonly runMode: RunMode;
|
20 | readonly tsNodeState?: TsNodeState;
|
21 | readonly program?: ts.Program;
|
22 | readonly config: TsTransformPathsConfig;
|
23 | readonly compilerOptions: CompilerOptions;
|
24 | readonly elisionMap: Map<ts.SourceFile, Map<ImportOrExportDeclaration, ImportOrExportDeclaration>>;
|
25 | readonly transformationContext: ts.TransformationContext;
|
26 | readonly rootDirs?: string[];
|
27 | readonly excludeMatchers: IMinimatch[] | undefined;
|
28 | readonly outputFileNamesCache: Map<SourceFile, string>;
|
29 | readonly pathsPatterns: readonly (string | Pattern)[] | undefined;
|
30 | readonly emitHost: EmitHost;
|
31 | }
|
32 | export interface VisitorContext extends TsTransformPathsContext {
|
33 | readonly factory: HarmonyFactory;
|
34 | readonly sourceFile: ts.SourceFile;
|
35 | readonly isDeclarationFile: boolean;
|
36 | readonly originalSourceFile: ts.SourceFile;
|
37 | getVisitor(): (node: ts.Node) => ts.VisitResult<ts.Node>;
|
38 | }
|
39 | export declare enum RunMode {
|
40 | TsNode = "ts-node",
|
41 | Manual = "manual",
|
42 | Program = "program"
|
43 | }
|
44 | export declare enum TsNodeState {
|
45 | Full = 0,
|
46 | Stripped = 1
|
47 | }
|