UNPKG

1.63 kBTypeScriptView Raw
1import type { Tree } from '@nrwl/devkit';
2import * as ts from 'typescript';
3export declare function insertChange(host: Tree, sourceFile: ts.SourceFile, filePath: string, insertPosition: number, contentToInsert: string): ts.SourceFile;
4export declare function replaceChange(host: Tree, sourceFile: ts.SourceFile, filePath: string, insertPosition: number, contentToInsert: string, oldContent: string): ts.SourceFile;
5export declare function removeChange(host: Tree, sourceFile: ts.SourceFile, filePath: string, removePosition: number, contentToRemove: string): ts.SourceFile;
6export declare function insertImport(host: Tree, source: ts.SourceFile, fileToEdit: string, symbolName: string, fileName: string, isDefault?: boolean): ts.SourceFile;
7export declare function addGlobal(host: Tree, source: ts.SourceFile, modulePath: string, statement: string): ts.SourceFile;
8export declare function getImport(source: ts.SourceFile, predicate: (a: any) => boolean): {
9 moduleSpec: string;
10 bindings: string[];
11}[];
12export declare function replaceNodeValue(host: Tree, sourceFile: ts.SourceFile, modulePath: string, node: ts.Node, content: string): ts.SourceFile;
13export declare function addParameterToConstructor(tree: Tree, source: ts.SourceFile, modulePath: string, opts: {
14 className: string;
15 param: string;
16}): ts.SourceFile;
17export declare function addMethod(tree: Tree, source: ts.SourceFile, modulePath: string, opts: {
18 className: string;
19 methodHeader: string;
20 body?: string;
21}): ts.SourceFile;
22export declare function findClass(source: ts.SourceFile, className: string, silent?: boolean): ts.ClassDeclaration;