diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f2ca4fe08..60ef278e8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -175,6 +175,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](es6-promise/es6-promise.d.ts) [es6-promise](https://github.com/jakearchibald/ES6-Promise) by [François de Campredon](https://github.com/fdecampredon), [vvakame](https://github.com/vvakame) * [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis) * [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto) +* [:link:](event-loop-lag/event-loop-lag.d.ts) [event-loop-lag](https://github.com/pebble/event-loop-lag) by [rogierschouten](https://github.com/rogierschouten) * [:link:](exit/exit.d.ts) [exit](https://github.com/cowboy/node-exit) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/LearnBoost/expect.js) by [Teppei Sato](https://github.com/teppeis) * [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame) diff --git a/event-loop-lag/event-loop-lag-tests.ts b/event-loop-lag/event-loop-lag-tests.ts new file mode 100644 index 000000000..8e20879af --- /dev/null +++ b/event-loop-lag/event-loop-lag-tests.ts @@ -0,0 +1,6 @@ +/// + +import lag = require("event-loop-lag"); + +var fn: () => number = lag(1000); +var n: number = fn(); diff --git a/event-loop-lag/event-loop-lag.d.ts b/event-loop-lag/event-loop-lag.d.ts new file mode 100644 index 000000000..199babd37 --- /dev/null +++ b/event-loop-lag/event-loop-lag.d.ts @@ -0,0 +1,14 @@ +// Type definitions for event-loop-lag 1.0.3 +// Project: https://github.com/pebble/event-loop-lag +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "event-loop-lag" { + + /** + * Accepts a number of milliseconds representing how often to refresh the event loop lag measurement and returns a function you can call to receive the latest lag measurement in milliseconds. + */ + function lag(interval: number): () => number; + + export = lag; +}