Add ps-tree types

This commit is contained in:
Alessio Paccoia
2018-05-20 13:00:58 +02:00
parent e22846ad77
commit 3c05f46d30
4 changed files with 52 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
// Type definitions for ps-tree 1.1
// Project: http://github.com/indexzero/ps-tree
// Definitions by: Alessio Paccoia <https://github.com/alessiopcc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace ps_tree {
interface PS {
COMMAND: string;
PPID: string;
PID: string;
STAT: string;
}
const prototype: {
};
}
declare function ps_tree(pid: number, callback: (error: Error, children: ReadonlyArray<ps_tree.PS>) => void): void;
export as namespace ps_tree;
export = ps_tree;
+8
View File
@@ -0,0 +1,8 @@
import * as ps_tree from "ps-tree";
ps_tree(1, (error: Error, children: ps_tree.PS[]) => {
children[0].COMMAND; // $ExpectType string
children[0].PID; // $ExpectType string
children[0].PPID; // $ExpectType string
children[0].STAT; // $ExpectType string
}); // $ExpectType void
+22
View 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",
"ps-tree-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }