fallback-engine-host.d.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /// <reference types="node" />
  2. /**
  3. * @license
  4. * Copyright Google Inc. All Rights Reserved.
  5. *
  6. * Use of this source code is governed by an MIT-style license that can be
  7. * found in the LICENSE file at https://angular.io/license
  8. */
  9. import { Observable } from 'rxjs';
  10. import { Url } from 'url';
  11. import { Collection, CollectionDescription, EngineHost, RuleFactory, SchematicDescription, Source, TaskExecutor, TypedSchematicContext } from '../src';
  12. export declare type FallbackCollectionDescription = {
  13. host: EngineHost<{}, {}>;
  14. description: CollectionDescription<{}>;
  15. };
  16. export declare type FallbackSchematicDescription = {
  17. description: SchematicDescription<{}, {}>;
  18. };
  19. export declare type FallbackContext = TypedSchematicContext<FallbackCollectionDescription, FallbackSchematicDescription>;
  20. /**
  21. * An EngineHost that support multiple hosts in a fallback configuration. If a host does not
  22. * have a collection/schematics, use the following host before giving up.
  23. */
  24. export declare class FallbackEngineHost implements EngineHost<{}, {}> {
  25. private _hosts;
  26. constructor();
  27. addHost<CollectionT extends object, SchematicT extends object>(host: EngineHost<CollectionT, SchematicT>): void;
  28. createCollectionDescription(name: string): CollectionDescription<FallbackCollectionDescription>;
  29. createSchematicDescription(name: string, collection: CollectionDescription<FallbackCollectionDescription>): SchematicDescription<FallbackCollectionDescription, FallbackSchematicDescription> | null;
  30. getSchematicRuleFactory<OptionT extends object>(schematic: SchematicDescription<FallbackCollectionDescription, FallbackSchematicDescription>, collection: CollectionDescription<FallbackCollectionDescription>): RuleFactory<OptionT>;
  31. createSourceFromUrl(url: Url, context: FallbackContext): Source | null;
  32. transformOptions<OptionT extends object, ResultT extends object>(schematic: SchematicDescription<FallbackCollectionDescription, FallbackSchematicDescription>, options: OptionT, context?: FallbackContext): Observable<ResultT>;
  33. transformContext(context: FallbackContext): FallbackContext;
  34. /**
  35. * @deprecated Use `listSchematicNames`.
  36. */
  37. listSchematics(collection: Collection<FallbackCollectionDescription, FallbackSchematicDescription>): string[];
  38. listSchematicNames(collection: CollectionDescription<FallbackCollectionDescription>): string[];
  39. createTaskExecutor(name: string): Observable<TaskExecutor>;
  40. hasTaskExecutor(name: string): boolean;
  41. }