mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* fix(tcp-ping): Fix incorrect typings for probe method * > revert version bump in comment
31 lines
459 B
TypeScript
31 lines
459 B
TypeScript
import * as tp from 'tcp-ping';
|
|
|
|
// $ExpectType void
|
|
tp.ping({}, (err, result) => {
|
|
// $ExpectType Result
|
|
result;
|
|
// $ExpectType Results[]
|
|
result.results;
|
|
});
|
|
|
|
// $ExpectError
|
|
tp.ping();
|
|
|
|
// $ExpectError
|
|
tp.ping({});
|
|
|
|
// $ExpectType void
|
|
tp.probe("localhost", 8080, (err, result) => {
|
|
// $ExpectType boolean
|
|
result;
|
|
});
|
|
|
|
// $ExpectError
|
|
tp.probe("localhost", 8080);
|
|
|
|
// $ExpectError
|
|
tp.probe("localhost");
|
|
|
|
// $ExpectError
|
|
tp.probe();
|