5.0.6 • Published 1 year ago

@types/rwlock v5.0.6

Weekly downloads
267
License
MIT
Repository
github
Last release
1 year ago

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

// Type definitions for RWLock 5.0
// Project: https://github.com/71104/rwlock
// Definitions by: Federico Caselli <https://github.com/CaselIT/typings-rwlock>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: Thu, 08 Jul 2021 22:42:16 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Federico Caselli.

5.0.6

1 year ago

5.0.5

1 year ago

5.0.4

1 year ago

5.0.3

3 years ago

5.0.2

8 years ago

5.0.1

8 years ago

5.0.0

8 years ago