mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
- Relax workers value to be a string or number. The library handles both, and this value is frequently supplied as an ENV. - Relax master in config object to be optional
24 lines
815 B
TypeScript
24 lines
815 B
TypeScript
// Type definitions for throng 4.0
|
|
// Project: https://github.com/hunterloftis/throng
|
|
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
|
// Tate Thurston <https://github.com/tatethurston>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare function throng(startOrOptions: throng.ProcessCallback | throng.Options): void;
|
|
declare function throng(workers: throng.WorkerCount, start: throng.ProcessCallback): void;
|
|
declare namespace throng {
|
|
type WorkerCount = number | string;
|
|
type ProcessCallback = (id: number) => any;
|
|
|
|
interface Options {
|
|
grace?: number;
|
|
lifetime?: number;
|
|
master?: ProcessCallback;
|
|
start: ProcessCallback;
|
|
workers?: WorkerCount;
|
|
}
|
|
}
|
|
|
|
export = throng;
|
|
export as namespace throng;
|