schema.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. };