UNPKG

2.65 kBTypeScriptView Raw
1import { ClassDeclaration, Decorator, Node, NodeArray, ObjectLiteralElement, ObjectLiteralExpression, ScriptTarget, SourceFile, SyntaxKind } from 'typescript';
2export declare function getTypescriptSourceFile(filePath: string, fileContent: string, languageVersion?: ScriptTarget, setParentNodes?: boolean): SourceFile;
3export declare function removeDecorators(fileName: string, source: string): string;
4export declare function findNodes(sourceFile: SourceFile, node: Node, kind: SyntaxKind, keepGoing?: boolean): Node[];
5export declare function replaceNode(filePath: string, fileContent: string, node: Node, replacement: string): string;
6export declare function removeNode(filePath: string, fileContent: string, node: Node): string;
7export declare function getNodeStringContent(sourceFile: SourceFile, node: Node): string;
8export declare function appendAfter(source: string, node: Node, toAppend: string): string;
9export declare function appendEmpty(source: string, position: number, toAppend: string): string;
10export declare function appendBefore(filePath: string, fileContent: string, node: Node, toAppend: string): string;
11export declare function insertNamedImportIfNeeded(filePath: string, fileContent: string, namedImport: string, fromModule: string): string;
12export declare function replaceNamedImport(filePath: string, fileContent: string, namedImportOriginal: string, namedImportReplacement: string): string;
13export declare function replaceImportModuleSpecifier(filePath: string, fileContent: string, moduleSpecifierOriginal: string, moduleSpecifierReplacement: string): string;
14export declare function checkIfFunctionIsCalled(filePath: string, fileContent: string, functionName: string): boolean;
15export declare function getClassDeclarations(sourceFile: SourceFile): ClassDeclaration[];
16export declare function getNgModuleClassName(filePath: string, fileContent: string): string;
17export declare function getNgModuleDecorator(fileName: string, sourceFile: SourceFile): Decorator;
18export declare function getNgModuleObjectLiteralArg(decorator: Decorator): ObjectLiteralExpression;
19export declare function findObjectLiteralElementByName(properties: NodeArray<ObjectLiteralElement>, identifierToLookFor: string): ObjectLiteralElement;
20export declare function appendNgModuleDeclaration(filePath: string, fileContent: string, declaration: string): string;
21export declare function appendNgModuleProvider(filePath: string, fileContent: string, declaration: string): string;
22export declare function appendNgModuleExports(filePath: string, fileContent: string, declaration: string): string;
23export declare const NG_MODULE_DECORATOR_TEXT = "NgModule";