DefinitelyTyped/types/tcp-ping/index.d.ts
Ryan Murthick 56c1e21df1
fix(tcp-ping): Fix incorrect typings for probe method (#43653)
* fix(tcp-ping): Fix incorrect typings for probe method

* > revert version bump in comment
2020-04-06 11:19:23 -07:00

32 lines
877 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>
// rymate1234 <https://github.com/rymate1234>
// 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: boolean) => void): void;