mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 01:47:21 +08: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)[].
28 lines
408 B
TypeScript
28 lines
408 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, () => {});
|
|
|
|
// $ExpectError
|
|
tp.probe("localhost", 8080);
|
|
|
|
// $ExpectError
|
|
tp.probe("localhost");
|
|
|
|
// $ExpectError
|
|
tp.probe();
|