DefinitelyTyped/types/blocked/index.d.ts
l-jonas 1809675f6a Add types for the package "blocked" (#25593)
* Add types for the package "blocked"

* Update author

* Rename MyFunction to Blocked

* Make options optional

* Return Node.JS timer instead of custom declaration
2018-05-08 12:51:10 -07:00

25 lines
762 B
TypeScript

// Type definitions for blocked 1.2
// Project: https://github.com/visionmedia/node-blocked#readme
// Definitions by: Jonas Lochmann <https://github.com/l-jonas>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
/*~ Note that ES6 modules cannot directly export callable functions.
*~ This file should be imported using the CommonJS-style:
*~ import x = require('someLibrary');
*~
*~ Refer to the documentation to understand common
*~ workarounds for this limitation of ES6 modules.
*/
export = Blocked;
declare function Blocked(callback: (ms: number) => void, options?: Blocked.Options): NodeJS.Timer;
declare namespace Blocked {
interface Options {
threshold: number; // in milliseconds
}
}