schema.d.ts 1.1 KB

123456789101112131415161718192021222324252627
  1. /**
  2. * Creates a new web worker in your project. Web workers allow you to run JavaScript code in
  3. * the background, improving the performance and responsiveness of your application by
  4. * offloading computationally intensive tasks. This schematic generates the necessary files
  5. * for a new web worker and provides an optional code snippet to demonstrate its usage.
  6. */
  7. export type Schema = {
  8. /**
  9. * The name for the new web worker. This will be used to create the worker file (e.g.,
  10. * `my-worker.worker.ts`).
  11. */
  12. name: string;
  13. /**
  14. * The path where the web worker file should be created, relative to the current workspace.
  15. * If not specified, the worker will be created in the current directory.
  16. */
  17. path?: string;
  18. /**
  19. * The name of the project where the web worker should be created. If not specified, the CLI
  20. * will determine the project from the current directory.
  21. */
  22. project: string;
  23. /**
  24. * Generate a code snippet that demonstrates how to create and use the new web worker.
  25. */
  26. snippet?: boolean;
  27. };