source: trip-planner-front/node_modules/@angular/cdk/schematics/utils/vendored-ast-utils/index.d.ts

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.8 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { Tree } from '@angular-devkit/schematics';
9import { Change } from '@schematics/angular/utility/change';
10import * as ts from 'typescript';
11/**
12 * Add Import `import { symbolName } from fileName` if the import doesn't exit
13 * already. Assumes fileToEdit can be resolved and accessed.
14 * @param fileToEdit (file we want to add import to)
15 * @param symbolName (item to import)
16 * @param fileName (path to the file)
17 * @param isDefault (if true, import follows style for importing default exports)
18 * @return Change
19 */
20export declare function insertImport(source: ts.SourceFile, fileToEdit: string, symbolName: string, fileName: string, isDefault?: boolean): Change;
21/**
22 * Find all nodes from the AST in the subtree of node of SyntaxKind kind.
23 * @param node
24 * @param kind
25 * @param max The maximum number of items to return.
26 * @param recursive Continue looking for nodes of kind recursive until end
27 * the last child even when node of kind has been found.
28 * @return all nodes of kind, or [] if none is found
29 */
30export declare function findNodes(node: ts.Node, kind: ts.SyntaxKind, max?: number, recursive?: boolean): ts.Node[];
31/**
32 * Get all the nodes from a source.
33 * @param sourceFile The source file object.
34 * @returns {Observable<ts.Node>} An observable of all the nodes in the source.
35 */
36export declare function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[];
37export declare function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null;
38/**
39 * Insert `toInsert` after the last occurence of `ts.SyntaxKind[nodes[i].kind]`
40 * or after the last of occurence of `syntaxKind` if the last occurence is a sub child
41 * of ts.SyntaxKind[nodes[i].kind] and save the changes in file.
42 *
43 * @param nodes insert after the last occurence of nodes
44 * @param toInsert string to insert
45 * @param file file to insert changes into
46 * @param fallbackPos position to insert if toInsert happens to be the first occurence
47 * @param syntaxKind the ts.SyntaxKind of the subchildren to insert after
48 * @return Change instance
49 * @throw Error if toInsert is first occurence but fall back is not set
50 */
51export declare function insertAfterLastOccurrence(nodes: ts.Node[], toInsert: string, file: string, fallbackPos: number, syntaxKind?: ts.SyntaxKind): Change;
52export declare function getDecoratorMetadata(source: ts.SourceFile, identifier: string, module: string): ts.Node[];
53export declare function getMetadataField(node: ts.ObjectLiteralExpression, metadataField: string): ts.ObjectLiteralElement[];
54export declare function addSymbolToNgModuleMetadata(source: ts.SourceFile, ngModulePath: string, metadataField: string, symbolName: string, importPath?: string | null): Change[];
55/**
56 * Custom function to insert a declaration (component, pipe, directive)
57 * into NgModule declarations. It also imports the component.
58 */
59export declare function addDeclarationToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
60/**
61 * Custom function to insert an NgModule into NgModule imports. It also imports the module.
62 */
63export declare function addImportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
64/**
65 * Custom function to insert an export into NgModule. It also imports it.
66 */
67export declare function addExportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
68export declare function findBootstrapModuleCall(host: Tree, mainPath: string): ts.CallExpression | null;
69export declare function findBootstrapModulePath(host: Tree, mainPath: string): string;
70export declare function getAppModulePath(host: Tree, mainPath: string): string;
Note: See TracBrowser for help on using the repository browser.