Merge pull request #22455 from tatethurston/throng-improve

throng: relax constraints
This commit is contained in:
Paul van Brenk
2017-12-28 14:42:05 -08:00
committed by GitHub
+8 -5
View File
@@ -1,18 +1,21 @@
// 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(options: throng.WorkerCallback | throng.Options | number, startFunction?: throng.WorkerCallback): void;
declare function throng(startOrOptions: throng.ProcessCallback | throng.Options): void;
declare function throng(workers: throng.WorkerCount, start: throng.ProcessCallback): void;
declare namespace throng {
type WorkerCallback = (id: number) => void;
type WorkerCount = number | string;
type ProcessCallback = (id: number) => any;
interface Options {
grace?: number;
lifetime?: number;
master(): void;
start: WorkerCallback;
workers: number;
master?: ProcessCallback;
start: ProcessCallback;
workers?: WorkerCount;
}
}