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

1.1.4 • Public • Published

Installation

npm install --save @types/semaphore

Summary

This package contains type definitions for semaphore (https://github.com/abrkn/semaphore.js).

Details

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

index.d.ts

declare function semaphore(capacity?: number): semaphore.Semaphore;

declare namespace semaphore {
    interface Task {
        (): void;
    }

    interface Semaphore {
        capacity: number;
        current: number;

        available(n: number): boolean;

        take(task: Task): void;
        take(n: number, task: Task): void;

        leave(n?: number): void;
    }
}
export = semaphore;

Additional Details

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

Credits

These definitions were written by Matt Frantz, Arturas Molcanovas, and Tanguy Antoine.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/semaphore

Weekly Downloads

18,916

Version

1.1.4

License

MIT

Unpacked Size

3.75 kB

Total Files

5

Last publish

Collaborators

  • types