@types/throng
TypeScript icon, indicating that this package has built-in type declarations

5.0.7 • Public • Published

Installation

npm install --save @types/throng

Summary

This package contains type definitions for throng (https://github.com/hunterloftis/throng).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/throng.

index.d.ts

declare function throng(startOrOptions: throng.WorkerCallback | throng.Options): Promise<void>;
declare function throng(workers: throng.WorkerCount, start: throng.WorkerCallback): Promise<void>;
declare namespace throng {
    type WorkerCount = number | string;
    type WorkerCallback = (id: number, disconnect: () => void) => void;
    type MasterCallback = () => void;

    type Options = {
        signals?: string[] | undefined;
        grace?: number | undefined;
        lifetime?: number | undefined;
        master?: MasterCallback | undefined;
        count?: number | undefined;
        workers?: WorkerCount | undefined;
    } & ({ start: WorkerCallback } | { worker: WorkerCallback });
}

export = throng;
export as namespace throng;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Cyril Schumacher.

/@types/throng/

    Package Sidebar

    Install

    npm i @types/throng

    Weekly Downloads

    16,088

    Version

    5.0.7

    License

    MIT

    Unpacked Size

    4.03 kB

    Total Files

    5

    Last publish

    Collaborators

    • types