schema.json 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "SchematicsAngularInterface",
  4. "title": "Angular Interface Options Schema",
  5. "type": "object",
  6. "additionalProperties": false,
  7. "description": "Creates a new interface in your project. Interfaces define the structure of objects in TypeScript, ensuring type safety and code clarity. This schematic generates a new interface with the specified name and type.",
  8. "properties": {
  9. "name": {
  10. "type": "string",
  11. "description": "The name for the new interface. This will be used to create the interface file (e.g., `my-interface.interface.ts`).",
  12. "$default": {
  13. "$source": "argv",
  14. "index": 0
  15. },
  16. "x-prompt": "What name would you like to use for the interface?"
  17. },
  18. "path": {
  19. "type": "string",
  20. "format": "path",
  21. "$default": {
  22. "$source": "workingDirectory"
  23. },
  24. "description": "The path where the interface file should be created, relative to the workspace root. If not provided, the interface will be created in the current directory.",
  25. "visible": false
  26. },
  27. "project": {
  28. "type": "string",
  29. "description": "The name of the project where the interface should be created. If not specified, the CLI will determine the project from the current directory.",
  30. "$default": {
  31. "$source": "projectName"
  32. }
  33. },
  34. "prefix": {
  35. "type": "string",
  36. "description": "A prefix to be added to the interface name. This is typically not used for interfaces, as they don't have selectors like components or directives."
  37. },
  38. "type": {
  39. "type": "string",
  40. "description": "Adds a custom type to the filename, allowing you to create more descriptive interface names. For example, if you set the type to `data`, the filename will be `my-interface.data.ts`.",
  41. "$default": {
  42. "$source": "argv",
  43. "index": 1
  44. }
  45. }
  46. },
  47. "required": ["name", "project"]
  48. }