node-modules-architect-host.d.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @license
  3. * Copyright Google Inc. 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 { experimental, json, workspaces } from '@angular-devkit/core';
  9. import { BuilderInfo } from '../src';
  10. import { Target } from '../src/input-schema';
  11. import { ArchitectHost, Builder } from '../src/internal';
  12. export declare type NodeModulesBuilderInfo = BuilderInfo & {
  13. import: string;
  14. };
  15. export declare class WorkspaceNodeModulesArchitectHost implements ArchitectHost<NodeModulesBuilderInfo> {
  16. protected _workspace: experimental.workspace.Workspace | workspaces.WorkspaceDefinition;
  17. protected _root: string;
  18. /**
  19. * @deprecated
  20. */
  21. constructor(_workspace: experimental.workspace.Workspace, _root: string);
  22. constructor(_workspace: workspaces.WorkspaceDefinition, _root: string);
  23. getBuilderNameForTarget(target: Target): Promise<any>;
  24. /**
  25. * Resolve a builder. This needs to be a string which will be used in a dynamic `import()`
  26. * clause. This should throw if no builder can be found. The dynamic import will throw if
  27. * it is unsupported.
  28. * @param builderStr The name of the builder to be used.
  29. * @returns All the info needed for the builder itself.
  30. */
  31. resolveBuilder(builderStr: string): Promise<NodeModulesBuilderInfo>;
  32. getCurrentDirectory(): Promise<string>;
  33. getWorkspaceRoot(): Promise<string>;
  34. getOptionsForTarget(target: Target): Promise<json.JsonObject | null>;
  35. loadBuilder(info: NodeModulesBuilderInfo): Promise<Builder>;
  36. private findProjectTarget;
  37. }