forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
usage.d.ts
28 lines (21 loc) · 716 Bytes
/
usage.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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):void;
export function lookup(pid:number, options:Options, callback:(err:Error, result:ResultObject) => void):void;
//Only availible on linux
export function clearHistory(pid?:number):void;
}