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

5.0.6 • Public • Published

Installation

npm install --save @types/rwlock

Summary

This package contains type definitions for rwlock (https://github.com/71104/rwlock).

Details

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

index.d.ts

declare class ReadWriteGeneric<T> {
    readLock(callback: T, options?: ReadWriteLock.Options): void;
    readLock(key: string, callback: T, options?: ReadWriteLock.Options): void;
    writeLock(callback: T, options?: ReadWriteLock.Options): void;
    writeLock(key: string, callback: T, options?: ReadWriteLock.Options): void;
}
declare namespace ReadWriteLock {
    type Release = () => void;

    type Callback = (release: Release) => void;

    type AsyncCallback = (err: Error, release: Release) => void;

    interface Options {
        scope?: any;
        timeout?: number | undefined;
        timeoutCallback?(): void;
    }
}

declare class ReadWriteLock extends ReadWriteGeneric<ReadWriteLock.Callback> {
    constructor();
    async: ReadWriteGeneric<ReadWriteLock.AsyncCallback>;
}
export = ReadWriteLock;

Additional Details

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

Credits

These definitions were written by Federico Caselli.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/rwlock

Weekly Downloads

1,329

Version

5.0.6

License

MIT

Unpacked Size

4.13 kB

Total Files

5

Last publish

Collaborators

  • types