standalone.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. */
  8. import { Tree } from '@angular-devkit/schematics';
  9. import 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. */
  16. export declare function importsProvidersFrom(tree: Tree, filePath: string, className: string): boolean;
  17. /**
  18. * Checks whether a providers function is being called in a `bootstrapApplication` call.
  19. * @param tree File tree of the project.
  20. * @param filePath Path of the file in which to check.
  21. * @param functionName Name of the function to search for.
  22. */
  23. export declare function callsProvidersFunction(tree: Tree, filePath: string, functionName: string): boolean;
  24. /**
  25. * Adds an `importProvidersFrom` call to the `bootstrapApplication` call.
  26. * @param tree File tree of the project.
  27. * @param filePath Path to the file that should be updated.
  28. * @param moduleName Name of the module that should be imported.
  29. * @param modulePath Path from which to import the module.
  30. */
  31. export declare function addModuleImportToStandaloneBootstrap(tree: Tree, filePath: string, moduleName: string, modulePath: string): void;
  32. /**
  33. * Adds a providers function call to the `bootstrapApplication` call.
  34. * @param tree File tree of the project.
  35. * @param filePath Path to the file that should be updated.
  36. * @param functionName Name of the function that should be called.
  37. * @param importPath Path from which to import the function.
  38. * @param args Arguments to use when calling the function.
  39. * @returns The file path that the provider was added to.
  40. */
  41. export declare function addFunctionalProvidersToStandaloneBootstrap(tree: Tree, filePath: string, functionName: string, importPath: string, args?: ts.Expression[]): string;
  42. /** Finds the call to `bootstrapApplication` within a file. */
  43. export declare function findBootstrapApplicationCall(sourceFile: ts.SourceFile): ts.CallExpression | null;