mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add types for the package "blocked" * Update author * Rename MyFunction to Blocked * Make options optional * Return Node.JS timer instead of custom declaration
25 lines
762 B
TypeScript
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
|
|
}
|
|
}
|