mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* 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)[].
31 lines
814 B
TypeScript
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;
|