description.d.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.dev/license
  7. */
  8. import { JsonObject } from '@angular-devkit/core';
  9. import { Collection, CollectionDescription, Engine, EngineHost, RuleFactory, Schematic, SchematicDescription, TypedSchematicContext } from '../src';
  10. export interface FileSystemCollectionDescription {
  11. readonly name: string;
  12. readonly path: string;
  13. readonly version?: string;
  14. readonly schematics: {
  15. [name: string]: FileSystemSchematicDesc;
  16. };
  17. readonly encapsulation?: boolean;
  18. }
  19. export interface FileSystemSchematicJsonDescription {
  20. readonly aliases?: string[];
  21. readonly factory: string;
  22. readonly name: string;
  23. readonly collection: FileSystemCollectionDescription;
  24. readonly description: string;
  25. readonly schema?: string;
  26. readonly extends?: string;
  27. }
  28. export interface FileSystemSchematicDescription extends FileSystemSchematicJsonDescription {
  29. readonly path: string;
  30. readonly schemaJson?: JsonObject;
  31. readonly factoryFn: RuleFactory<{}>;
  32. }
  33. /**
  34. * Used to simplify typings.
  35. */
  36. export declare type FileSystemEngine = Engine<FileSystemCollectionDescription, FileSystemSchematicDescription>;
  37. export declare type FileSystemEngineHost = EngineHost<FileSystemCollectionDescription, FileSystemSchematicDescription>;
  38. export declare type FileSystemCollection = Collection<FileSystemCollectionDescription, FileSystemSchematicDescription>;
  39. export declare type FileSystemSchematic = Schematic<FileSystemCollectionDescription, FileSystemSchematicDescription>;
  40. export declare type FileSystemCollectionDesc = CollectionDescription<FileSystemCollectionDescription>;
  41. export declare type FileSystemSchematicDesc = SchematicDescription<FileSystemCollectionDescription, FileSystemSchematicDescription>;
  42. export declare type FileSystemSchematicContext = TypedSchematicContext<FileSystemCollectionDescription, FileSystemSchematicDescription>;