UNPKG

2.98 kBTypeScriptView Raw
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 ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript';
10/**
11 * Checks whether the providers from a module are being imported in a `bootstrapApplication` call.
12 * @param tree File tree of the project.
13 * @param filePath Path of the file in which to check.
14 * @param className Class name of the module to search for.
15 * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
16 * `@schematics/angular/utility` instead.
17 */
18export declare function importsProvidersFrom(tree: Tree, filePath: string, className: string): boolean;
19/**
20 * Checks whether a providers function is being called in a `bootstrapApplication` call.
21 * @param tree File tree of the project.
22 * @param filePath Path of the file in which to check.
23 * @param functionName Name of the function to search for.
24 * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
25 * `@schematics/angular/utility` instead.
26 */
27export declare function callsProvidersFunction(tree: Tree, filePath: string, functionName: string): boolean;
28/**
29 * Adds an `importProvidersFrom` call to the `bootstrapApplication` call.
30 * @param tree File tree of the project.
31 * @param filePath Path to the file that should be updated.
32 * @param moduleName Name of the module that should be imported.
33 * @param modulePath Path from which to import the module.
34 * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
35 * `@schematics/angular/utility` instead.
36 */
37export declare function addModuleImportToStandaloneBootstrap(tree: Tree, filePath: string, moduleName: string, modulePath: string): void;
38/**
39 * Adds a providers function call to the `bootstrapApplication` call.
40 * @param tree File tree of the project.
41 * @param filePath Path to the file that should be updated.
42 * @param functionName Name of the function that should be called.
43 * @param importPath Path from which to import the function.
44 * @param args Arguments to use when calling the function.
45 * @returns The file path that the provider was added to.
46 * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
47 * `@schematics/angular/utility` instead.
48 */
49export declare function addFunctionalProvidersToStandaloneBootstrap(tree: Tree, filePath: string, functionName: string, importPath: string, args?: ts.Expression[]): string;
50/**
51 * Finds the call to `bootstrapApplication` within a file.
52 * @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
53 * `@schematics/angular/utility` instead.
54 */
55export declare function findBootstrapApplicationCall(sourceFile: ts.SourceFile): ts.CallExpression | null;