mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
sequester: add typings (#12343)
* sequester: add typings https://github.com/bigeasy/sequester https://www.npmjs.com/package/sequester * Change tsconfig files section
This commit is contained in:
committed by
Masahiro Wakame
parent
8b066c8528
commit
15ba795ddb
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for sequester 1.0.0
|
||||
// Project: https://github.com/bigeasy/sequester
|
||||
// Definitions by: Artur Eshenbrener <https://github.com/Strate>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type Callback = () => void;
|
||||
|
||||
export interface Lock {
|
||||
share(cb: Callback): void;
|
||||
exclude(cb: Callback): void;
|
||||
count: number;
|
||||
dispose(): void;
|
||||
unlock(): void;
|
||||
downgrade(): void;
|
||||
}
|
||||
|
||||
export function createLock(): Lock;
|
||||
@@ -0,0 +1,13 @@
|
||||
import * as sequester from "sequester";
|
||||
|
||||
function cb() {};
|
||||
|
||||
{
|
||||
const lock = sequester.createLock();
|
||||
lock.share(cb);
|
||||
lock.exclude(cb);
|
||||
const a: number = lock.count;
|
||||
lock.unlock();
|
||||
lock.downgrade();
|
||||
lock.dispose();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"sequester-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user