Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.d.ts 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { ForkOptions } from "child_process";
  2. export = Farm;
  3. declare function Farm(name: string): Farm.Workers;
  4. declare function Farm(name: string, exportedMethods: string[]): Farm.Workers;
  5. declare function Farm(options: Farm.FarmOptions, name: string): Farm.Workers;
  6. declare function Farm(
  7. options: Farm.FarmOptions,
  8. name: string,
  9. exportedMethods: string[],
  10. ): Farm.Workers;
  11. type WorkerCallback0 = () => void;
  12. type WorkerCallback1 = (arg1: any) => void;
  13. type WorkerCallback2 = (arg1: any, arg2: any) => void;
  14. type WorkerCallback3 = (arg1: any, arg2: any, arg3: any) => void;
  15. type WorkerCallback4 = (arg1: any, arg2: any, arg3: any, arg4: any) => void;
  16. declare namespace Farm {
  17. export function end(workers: Workers, callback?: Function): void;
  18. export interface Workers {
  19. [x: string]: Workers,
  20. (callback: WorkerCallback): void;
  21. (arg1: any, callback: WorkerCallback): void;
  22. (arg1: any, arg2: any, callback: WorkerCallback): void;
  23. (arg1: any, arg2: any, arg3: any, callback: WorkerCallback): void;
  24. (
  25. arg1: any,
  26. arg2: any,
  27. arg3: any,
  28. arg4: any,
  29. callback: WorkerCallback,
  30. ): void;
  31. }
  32. export interface FarmOptions {
  33. maxCallsPerWorker?: number;
  34. maxConcurrentWorkers?: number;
  35. maxConcurrentCallsPerWorker?: number;
  36. maxConcurrentCalls?: number;
  37. maxCallTime?: number;
  38. maxRetries?: number;
  39. autoStart?: boolean;
  40. workerOptions?: ForkOptions;
  41. }
  42. export type WorkerCallback =
  43. | WorkerCallback0
  44. | WorkerCallback1
  45. | WorkerCallback2
  46. | WorkerCallback3
  47. | WorkerCallback4;
  48. }