mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
Add types for pid-from-port
This commit is contained in:
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for pid-from-port 1.1
|
||||
// Project: https://github.com/kevva/pid-from-port#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = pidFromPort;
|
||||
|
||||
/**
|
||||
* Get PID from a port
|
||||
* @param port Port to lookup.
|
||||
*/
|
||||
declare function pidFromPort(port: number): Promise<number>;
|
||||
|
||||
declare namespace pidFromPort {
|
||||
/**
|
||||
* Get PIDs for a list of ports.
|
||||
* @param ports Ports to lookup.
|
||||
* @returns A `Promise<Map>` with the port as key and the PID as value.
|
||||
*/
|
||||
function all(ports: number[]): Promise<Map<number, number>>;
|
||||
/**
|
||||
* Get all PIDs from ports.
|
||||
* @returns A `Promise<Map>` with the port as key and the PID as value.
|
||||
*/
|
||||
function list(): Promise<Map<number, number>>;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import pidFromPort = require('pid-from-port');
|
||||
|
||||
// $ExpectType Promise<number>
|
||||
pidFromPort(8080);
|
||||
|
||||
// $ExpectType Promise<Map<number, number>>
|
||||
pidFromPort.all([8080, 22]);
|
||||
|
||||
// $ExpectType Promise<Map<number, number>>
|
||||
pidFromPort.list();
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"pid-from-port-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user