schema.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Creates a new resolver in your project. Resolvers are used to pre-fetch data before a
  3. * route is activated, ensuring that the necessary data is available before the component is
  4. * displayed. This can improve the user experience by preventing delays and loading states.
  5. * This schematic generates a new resolver with the specified name and options.
  6. */
  7. export type Schema = {
  8. /**
  9. * Creates the new resolver files at the top level of the current project. If set to false,
  10. * a new folder with the resolver's name will be created to contain the files.
  11. */
  12. flat?: boolean;
  13. /**
  14. * Creates the resolver as a function `ResolveFn` instead of a class. Functional resolvers
  15. * can be simpler for basic scenarios.
  16. */
  17. functional?: boolean;
  18. /**
  19. * The name for the new resolver. This will be used to create the resolver's class and spec
  20. * files (e.g., `my-resolver.resolver.ts` and `my-resolver.resolver.spec.ts`).
  21. */
  22. name: string;
  23. /**
  24. * The path where the resolver files should be created, relative to the current workspace.
  25. * If not provided, the resolver will be created in the current directory.
  26. */
  27. path?: string;
  28. /**
  29. * The name of the project where the resolver should be created. If not specified, the CLI
  30. * will determine the project from the current directory.
  31. */
  32. project: string;
  33. /**
  34. * Skip the generation of a unit test file `spec.ts` for the new resolver.
  35. */
  36. skipTests?: boolean;
  37. };