npm.io
1.0.4 • Published 2 years ago

@types/slocket

Licence
MIT
Version
1.0.4
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.3K

Installation

npm install --save @types/slocket

Summary

This package contains type definitions for slocket (https://github.com/isaacs/slocket#readme).

Details

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

index.d.ts

/// <reference types="node" />
import { EventEmitter } from "events";

export = slocket;

declare const slocket: Slocket;

interface Slocket {
    (lockFile: string, cb?: (error: Error | null, lock: slocket.Lock) => void): slocket.Slocket;
    new(lockFile: string, cb?: (error: Error | null, lock: slocket.Lock) => void): slocket.Slocket;
}

declare namespace slocket {
    interface Slocket extends EventEmitter {
        then<TResult1 = Lock, TResult2 = never>(
            onfulfilled?: ((value: Lock) => TResult1 | PromiseLike<TResult1>) | null,
            onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
        ): Promise<TResult1 | TResult2>;
        catch<TResult = never>(
            onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,
        ): Promise<Lock | TResult>;
    }

    interface Lock {
        release(sync?: boolean): void;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 1536 GMT
  • Dependencies: @types/node

Credits

These definitions were written by BendingBender.