mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 06:29:40 +08:00
Merge pull request #25896 from alessiopcc/ps-tree
Add ps-tree definitions
This commit is contained in:
22
types/ps-tree/index.d.ts
vendored
Normal file
22
types/ps-tree/index.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// 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
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
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;
|
||||
9
types/ps-tree/ps-tree-tests.ts
Normal file
9
types/ps-tree/ps-tree-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import ps_tree from "ps-tree";
|
||||
|
||||
ps_tree(1, () => {}); // $ExpectType void
|
||||
ps_tree(1, (error: Error, children: ReadonlyArray<ps_tree.PS>) => {
|
||||
children[0].COMMAND; // $ExpectType string
|
||||
children[0].PID; // $ExpectType string
|
||||
children[0].PPID; // $ExpectType string
|
||||
children[0].STAT; // $ExpectType string
|
||||
});
|
||||
24
types/ps-tree/tsconfig.json
Normal file
24
types/ps-tree/tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ps-tree-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/ps-tree/tslint.json
Normal file
1
types/ps-tree/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user