ast.d.ts 1.3 KB

12345678910111213141516171819202122232425
  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 { WorkspaceProject } from '@angular-devkit/core/src/experimental/workspace';
  9. import { Tree } from '@angular-devkit/schematics';
  10. import { Schema as ComponentOptions } from '@schematics/angular/component/schema';
  11. import { typescript } from './version-agnostic-typescript';
  12. /** Reads file given path and returns TypeScript source file. */
  13. export declare function getSourceFile(host: Tree, path: string): typescript.SourceFile;
  14. /** Import and add module to root app module. */
  15. export declare function addModuleImportToRootModule(host: Tree, moduleName: string, src: string, project: WorkspaceProject): void;
  16. /**
  17. * Import and add module to specific module path.
  18. * @param host the tree we are updating
  19. * @param modulePath src location of the module to import
  20. * @param moduleName name of module to import
  21. * @param src src location to import
  22. */
  23. export declare function addModuleImportToModule(host: Tree, modulePath: string, moduleName: string, src: string): void;
  24. /** Wraps the internal find module from options with undefined path handling */
  25. export declare function findModuleFromOptions(host: Tree, options: ComponentOptions): string | undefined;