Nodeschool Public Materials

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

    1.1.3 • Public • Published

    Installation

    npm install --save @types/async-lock

    Summary

    This package contains type definitions for async-lock (https://github.com/rain1017/async-lock).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async-lock.

    index.d.ts

    // Type definitions for async-lock 1.1
    // Project: https://github.com/rain1017/async-lock, https://github.com/rogierschouten/async-lock
    // Definitions by: Elisée MAURER <https://github.com/elisee>
    //                 Alejandro <https://github.com/afharo>
    //                 Anatoly <https://github.com/rhymmor>
    //                 Humulus <https://github.com/humulus>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.1
    
    type AsyncLockDoneCallback<T> = (err?: Error, ret?: T) => void;
    
    interface AsyncLockOptions {
        timeout?: number | undefined;
        maxPending?: number | undefined;
        domainReentrant?: boolean | undefined;
        Promise?: any;
        skipQueue?: boolean | undefined;
    }
    
    declare class AsyncLock {
        constructor(options?: AsyncLockOptions);
    
        acquire<T>(key: string | string[],
                   fn: (() => T | PromiseLike<T>) | ((done: AsyncLockDoneCallback<T>) => any),
                   opts?: AsyncLockOptions): Promise<T>;
        acquire<T>(key: string | string[],
                   fn: (done: AsyncLockDoneCallback<T>) => any,
                   cb: AsyncLockDoneCallback<T>,
                   opts?: AsyncLockOptions): void;
    
        isBusy(key?: string): boolean;
    }
    
    declare namespace AsyncLock { }
    
    export = AsyncLock;

    Additional Details

    • Last updated: Tue, 06 Jul 2021 18:05:36 GMT
    • Dependencies: none
    • Global values: none

    Credits

    These definitions were written by Elisée MAURER, Alejandro, Anatoly, and Humulus.

    Keywords

    none

    Install

    npm i @types/async-lock

    DownloadsWeekly Downloads

    78,677

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    5.64 kB

    Total Files

    4

    Last publish

    Collaborators

    • types