mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add definition for "pidusage". (#16126)
* Add definition for "throng". * Fix tslint errors. * Add definition for "pidusage". * Remove definition for "throng". * Fix mistakes.
This commit is contained in:
parent
031d1a1b33
commit
4bf3c5c926
12
types/pidusage/index.d.ts
vendored
Normal file
12
types/pidusage/index.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
// Type definitions for pidusage 1.1
|
||||
// Project: https://github.com/soyuka/pidusage
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Stat {
|
||||
cpu: number;
|
||||
memory: number;
|
||||
}
|
||||
|
||||
export function stat(pid: number, callback: (error: Error, stat: Stat) => void): void;
|
||||
export function unmonitor(pid: number): void;
|
||||
8
types/pidusage/pidusage-tests.ts
Normal file
8
types/pidusage/pidusage-tests.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import pusage = require("pidusage");
|
||||
|
||||
pusage.stat(0, (err: Error, stat: pusage.Stat) => {
|
||||
const cpu = stat.cpu;
|
||||
const memory = stat.memory;
|
||||
});
|
||||
|
||||
pusage.unmonitor(0);
|
||||
22
types/pidusage/tsconfig.json
Normal file
22
types/pidusage/tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"pidusage-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/pidusage/tslint.json
Normal file
3
types/pidusage/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user