From b710efd71c36261207ac2ea65c5ed25f0a137cd9 Mon Sep 17 00:00:00 2001 From: Tate Date: Thu, 21 Dec 2017 14:40:57 -0800 Subject: [PATCH] Throng improvements - 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 --- types/throng/index.d.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/types/throng/index.d.ts b/types/throng/index.d.ts index 76a64932db..f962ce1ca9 100644 --- a/types/throng/index.d.ts +++ b/types/throng/index.d.ts @@ -1,18 +1,21 @@ // Type definitions for throng 4.0 // Project: https://github.com/hunterloftis/throng // Definitions by: Cyril Schumacher +// Tate Thurston // 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; } }