schema.d.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Creates a new interceptor in your project. Interceptors are used to intercept and modify
  3. * HTTP requests and responses before they reach their destination. This allows you to
  4. * perform tasks like adding authentication headers, handling errors, or logging requests.
  5. * This schematic generates the necessary files and boilerplate code for a new interceptor.
  6. */
  7. export type Schema = {
  8. /**
  9. * Creates the new interceptor files at the top level of the current project. If set to
  10. * false, a new folder with the interceptor's name will be created to contain the files.
  11. */
  12. flat?: boolean;
  13. /**
  14. * Creates the interceptor as a function `HttpInterceptorFn` instead of a class. Functional
  15. * interceptors can be simpler for basic scenarios.
  16. */
  17. functional?: boolean;
  18. /**
  19. * The name for the new interceptor. This will be used to create the interceptor's class and
  20. * spec files (e.g., `my-interceptor.interceptor.ts` and
  21. * `my-interceptor.interceptor.spec.ts`).
  22. */
  23. name: string;
  24. /**
  25. * The path where the interceptor files should be created, relative to the workspace root.
  26. * If not provided, the interceptor will be created in the current directory.
  27. */
  28. path?: string;
  29. /**
  30. * The name of the project where the interceptor should be created. If not specified, the
  31. * CLI will determine the project from the current directory.
  32. */
  33. project: string;
  34. /**
  35. * Skip the generation of a unit test file `spec.ts` for the new interceptor.
  36. */
  37. skipTests?: boolean;
  38. /**
  39. * The separator character to use before the type within the generated file's name. For
  40. * example, if you set the option to `.`, the file will be named `example.interceptor.ts`.
  41. */
  42. typeSeparator?: TypeSeparator;
  43. };
  44. /**
  45. * The separator character to use before the type within the generated file's name. For
  46. * example, if you set the option to `.`, the file will be named `example.interceptor.ts`.
  47. */
  48. export declare enum TypeSeparator {
  49. Empty = "-",
  50. TypeSeparator = "."
  51. }