From d006e5212b499c1a512f0d25a74b78ad97557459 Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Wed, 11 Feb 2015 13:48:12 +0100 Subject: [PATCH 1/2] Add typings for module event-loop-lag --- CONTRIBUTORS.md | 1 + event-loop-lag/event-loop-lag-tests.ts | 6 ++++++ event-loop-lag/event-loop-lag.d.ts | 14 ++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 event-loop-lag/event-loop-lag-tests.ts create mode 100644 event-loop-lag/event-loop-lag.d.ts 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..c822962db --- /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 (https://github.com/rogierschouten) +// 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; +} From 62fad4c6dfc9735b475ce41dbc7d816d051089e3 Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Fri, 13 Feb 2015 09:09:00 +0100 Subject: [PATCH 2/2] travis build fix. --- event-loop-lag/event-loop-lag.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/event-loop-lag/event-loop-lag.d.ts b/event-loop-lag/event-loop-lag.d.ts index c822962db..199babd37 100644 --- a/event-loop-lag/event-loop-lag.d.ts +++ b/event-loop-lag/event-loop-lag.d.ts @@ -1,6 +1,6 @@ // Type definitions for event-loop-lag 1.0.3 // Project: https://github.com/pebble/event-loop-lag -// Definitions by: Rogier Schouten (https://github.com/rogierschouten) +// Definitions by: Rogier Schouten // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module "event-loop-lag" {