sandboxed-options.d.ts 1.1 KB

1234567891011121314151617181920212223242526
  1. import { ForkOptions } from 'child_process';
  2. import { WorkerOptions as WorkerThreadsOptions } from 'worker_threads';
  3. export interface SandboxedOptions {
  4. /**
  5. * Use Worker Threads instead of Child Processes.
  6. * Note: This option can only be used when specifying
  7. * a file for the processor argument.
  8. *
  9. * @defaultValue false
  10. */
  11. useWorkerThreads?: boolean;
  12. /**
  13. * Support passing Worker Fork Options.
  14. * Note: This option can only be used when specifying
  15. * a file for the processor argument and useWorkerThreads is passed as false (default value).
  16. * @see {@link https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options}
  17. */
  18. workerForkOptions?: ForkOptions;
  19. /**
  20. * Support passing Worker Threads Options.
  21. * Note: This option can only be used when specifying
  22. * a file for the processor argument and useWorkerThreads is passed as true.
  23. * @see {@link https://nodejs.org/api/worker_threads.html#new-workerfilename-options}
  24. */
  25. workerThreadsOptions?: WorkerThreadsOptions;
  26. }