DefinitelyTyped/types/tcp-ping/index.d.ts
JUNG YONG WOO 2254f60b46 Add type definition for tcp-ping. (#20681)
* Add: Type definitions `tcp-ping`@`0.1.1`

* Remove: `strictFunctionTypes` property.

* Add: `tslint.json`

* Change: `strictNullChecks` property is set to true.

* Add: `strictFunctionTypes` property.

* Update: Apply the DTSLint rules.

* Update: Removed jsdoc comments information.

* Add: Tests

* Change: Missing file(`tcp-ping-tests.ts`) has been added to lsit of files.

* Change: Removes all unnecessary characters.

* Update: Add Tests.

* Update: `tcp-ping/index.d.ts`

* Update: Modified Results of Result type is Result(newly added)[].
2017-10-25 11:11:56 -07:00

31 lines
814 B
TypeScript

// Type definitions for tcp-ping 0.1
// Project: https://github.com/wesolyromek/tcp-ping
// Definitions by: JUNG YONG WOO <https://github.com/stegano>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface Options {
address?: string;
port?: number;
attempts?: number;
timeout?: number;
}
export interface Results {
seq: number | undefined;
time: number | undefined;
error?: Error;
}
export interface Result {
address: string;
port: number;
attempts: number;
avg: number;
max: number;
min: number;
results: Results[];
}
export function ping(options: Options, callback: (error: Error, result: Result) => void): void;
export function probe(address: string, port: number, callback: (error: Error, result: Result) => void): void;