Add typings for module usage

This commit is contained in:
Pascal Vomhoff
2015-08-08 17:35:36 +02:00
parent 8de599097a
commit a71b9f2396
2 changed files with 47 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for usage
// Project: https://github.com/arunoda/node-usage
// Definitions by: Pascal Vomhoff <https://github.com/pvomhoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "usage" {
export interface ResultObject {
memory:number;
memoryInfo: {
rss:number;
vsize:number;
}
cpu:number;
}
export interface Options {
keepHistory:boolean;
}
export function lookup(pid:number, callback:(err:Error, result:ResultObject) => void);
export function lookup(pid:number, options:Options, callback:(err:Error, result:ResultObject) => void);
//Only availible on linux
export function clearHistory(pid?:number);
}