mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-28 19:52:53 +00:00
add types for windows-mutex (#40873)
This commit is contained in:
parent
b6ea495cd1
commit
dee38ca920
12
types/windows-mutex/index.d.ts
vendored
Normal file
12
types/windows-mutex/index.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
// Type definitions for windows-mutex 0.4
|
||||
// Project: https://github.com/Microsoft/node-windows-mutex
|
||||
// Definitions by: Benjamin Pasero <https://github.com/bpasero>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export class Mutex {
|
||||
constructor(name: string);
|
||||
isActive(): boolean;
|
||||
release(): void;
|
||||
}
|
||||
|
||||
export function isActive(name: string): boolean;
|
||||
23
types/windows-mutex/tsconfig.json
Normal file
23
types/windows-mutex/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"windows-mutex-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/windows-mutex/tslint.json
Normal file
1
types/windows-mutex/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
8
types/windows-mutex/windows-mutex-tests.ts
Normal file
8
types/windows-mutex/windows-mutex-tests.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import * as windowsMutex from "windows-mutex";
|
||||
|
||||
const name = 'mutex-name';
|
||||
|
||||
windowsMutex.isActive(name);
|
||||
const mutex = new windowsMutex.Mutex(name);
|
||||
mutex.isActive();
|
||||
mutex.release();
|
||||
Loading…
Reference in New Issue
Block a user