schema.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Creates a new class in your project. Classes are the fundamental building blocks for
  3. * object-oriented programming in TypeScript. They provide a blueprint for creating objects
  4. * with properties and methods. This schematic helps you generate a new class with the basic
  5. * structure and optional test files.
  6. */
  7. export type Schema = {
  8. /**
  9. * The name for the new class. This will be used to create the class file (e.g.,
  10. * `my-class.ts`) and, if enabled, the corresponding test file `my-class.spec.ts`.
  11. */
  12. name: string;
  13. /**
  14. * The path where the class file should be created, relative to the workspace root. If not
  15. * specified, the class will be created in the current directory.
  16. */
  17. path?: string;
  18. /**
  19. * The name of the project where the class should be added. If not specified, the CLI will
  20. * determine the project from the current directory.
  21. */
  22. project: string;
  23. /**
  24. * Skip the generation of a unit test file `spec.ts` for the new class.
  25. */
  26. skipTests?: boolean;
  27. /**
  28. * Adds a custom type to the filename, allowing you to create more descriptive class names.
  29. * For example, if you set the type to `helper`, the filename will be `my-class.helper.ts`.
  30. */
  31. type?: string;
  32. };