1 | import { Project, SourceFile } from "ts-morph";
|
2 | /**
|
3 | * Create an AST source file. Any files imported from the main file must also be provided.
|
4 | * All files will be loaded into a virtual filesystem under a `test/` directory.
|
5 | *
|
6 | * @param mainFile details for main file
|
7 | * @param referencedContent details for referenced files
|
8 | * @returns the main source file
|
9 | */
|
10 | export declare function createSourceFile(mainFile: FileDetail, ...referencedFiles: FileDetail[]): SourceFile;
|
11 | interface FileDetail {
|
12 | /** File path */
|
13 | path: string;
|
14 | /** File content */
|
15 | content: string;
|
16 | }
|
17 | /**
|
18 | * Create an AST project with the `@airtasker/spot` depedency loaded.
|
19 | */
|
20 | export declare function createProject(): Project;
|
21 | export declare function createProjectFromExistingSourceFile(filePath: string): {
|
22 | project: Project;
|
23 | file: SourceFile;
|
24 | };
|
25 | /**
|
26 | * Validate an AST project's correctness.
|
27 | *
|
28 | * @param project an AST project
|
29 | */
|
30 | export declare function validateProject(project: Project): void;
|
31 | export {};
|