1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import type { Rule, SchematicContext, Source, Tree } from '@angular-devkit/schematics';
|
9 | import type * as ts from 'typescript';
|
10 | import type { Path } from '@angular-devkit/core';
|
11 | import type { NxJsonConfiguration } from '@nrwl/devkit';
|
12 | export declare function sortObjectByKeys(obj: unknown): {};
|
13 | export { findNodes } from '../utilities/typescript/find-nodes';
|
14 | export { getSourceNodes } from '../utilities/typescript/get-source-nodes';
|
15 | export interface Change {
|
16 | apply(host: any): Promise<void>;
|
17 | readonly type: string;
|
18 | readonly path: string | null;
|
19 | readonly order: number;
|
20 | readonly description: string;
|
21 | }
|
22 | export declare class NoopChange implements Change {
|
23 | type: string;
|
24 | description: string;
|
25 | order: number;
|
26 | path: any;
|
27 | apply(): Promise<void>;
|
28 | }
|
29 | export declare class InsertChange implements Change {
|
30 | path: string;
|
31 | pos: number;
|
32 | toAdd: string;
|
33 | type: string;
|
34 | order: number;
|
35 | description: string;
|
36 | constructor(path: string, pos: number, toAdd: string);
|
37 | apply(host: any): any;
|
38 | }
|
39 | export declare class RemoveChange implements Change {
|
40 | path: string;
|
41 | pos: number;
|
42 | toRemove: string;
|
43 | type: string;
|
44 | order: number;
|
45 | description: string;
|
46 | constructor(path: string, pos: number, toRemove: string);
|
47 | apply(host: any): Promise<void>;
|
48 | }
|
49 | export declare class ReplaceChange implements Change {
|
50 | path: string;
|
51 | pos: number;
|
52 | oldText: string;
|
53 | newText: string;
|
54 | type: string;
|
55 | order: number;
|
56 | description: string;
|
57 | constructor(path: string, pos: number, oldText: string, newText: string);
|
58 | apply(host: any): Promise<void>;
|
59 | }
|
60 | export declare function addParameterToConstructor(source: ts.SourceFile, modulePath: string, opts: {
|
61 | className: string;
|
62 | param: string;
|
63 | }): Change[];
|
64 | export declare function addMethod(source: ts.SourceFile, modulePath: string, opts: {
|
65 | className: string;
|
66 | methodHeader: string;
|
67 | body: string;
|
68 | }): Change[];
|
69 | export declare function findClass(source: ts.SourceFile, className: string, silent?: boolean): ts.ClassDeclaration;
|
70 | export declare function offset(text: string, numberOfTabs: number, wrap: boolean): string;
|
71 | export declare function addIncludeToTsConfig(tsConfigPath: string, source: ts.SourceFile, include: string): Change[];
|
72 | export declare function getImport(source: ts.SourceFile, predicate: (a: any) => boolean): {
|
73 | moduleSpec: string;
|
74 | bindings: string[];
|
75 | }[];
|
76 | export declare function addGlobal(source: ts.SourceFile, modulePath: string, statement: string): Change[];
|
77 | export declare function insert(host: Tree, modulePath: string, changes: Change[]): void;
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | export declare function readJsonInTree<T extends object = any>(host: Tree, path: string): T;
|
85 | export declare function allFilesInDirInHost(host: Tree, path: Path, options?: {
|
86 | recursive: boolean;
|
87 | }): Path[];
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 | export declare function updateJsonInTree<T extends object = any, O extends object = T>(path: string, callback: (json: T, context: SchematicContext) => O): Rule;
|
95 | export declare function updateWorkspaceInTree<T extends object = any, O extends object = T>(callback: (json: T, context: SchematicContext, host: Tree) => O): Rule;
|
96 | export declare function readNxJsonInTree(host: Tree): NxJsonConfiguration<string[] | "*">;
|
97 | export declare function libsDir(host: Tree): string;
|
98 | export declare function appsDir(host: Tree): string;
|
99 | export declare function updateNxJsonInTree(callback: (json: NxJsonConfiguration, context: SchematicContext) => NxJsonConfiguration): Rule;
|
100 | export declare function readWorkspace(host: Tree): any;
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | export declare function addDepsToPackageJson(deps: any, devDeps: any, addInstall?: boolean): Rule;
|
110 | export declare function updatePackageJsonDependencies(deps: any, devDeps: any, addInstall?: boolean): Rule;
|
111 | export declare function getProjectConfig(host: Tree, name: string): any;
|
112 | export declare function createOrUpdate(host: Tree, path: string, content: string): void;
|
113 | export declare function insertImport(source: ts.SourceFile, fileToEdit: string, symbolName: string, fileName: string, isDefault?: boolean): Change;
|
114 | export declare function replaceNodeValue(host: Tree, modulePath: string, node: ts.Node, content: string): void;
|
115 | export declare function renameSyncInTree(tree: Tree, from: string, to: string, cb: (err: string) => void): void;
|
116 | export declare function renameDirSyncInTree(tree: Tree, from: string, to: string, cb: (err: string) => void): void;
|
117 |
|
118 |
|
119 |
|
120 | export declare function applyWithSkipExisting(source: Source, rules: Rule[]): Rule;
|