Files
DefinitelyTyped/types/default-gateway/default-gateway-tests.ts

30 lines
573 B
TypeScript

import { gateway4async, gateway6async, gateway4sync, gateway6sync, type Result } from 'default-gateway';
gateway4async().then((g) => {
// $ExpectType Result<4>
g;
// $ExpectType string
g.gateway;
// $ExpectType 4
g.version;
// $ExpectType string | null
g.int;
});
// $ExpectType Result<4>
gateway4sync();
gateway6async().then((g) => {
// $ExpectType Result<6>
g;
// $ExpectType string
g.gateway;
// $ExpectType 6
g.version;
// $ExpectType string | null
g.int;
});
// $ExpectType Result<6>
gateway6sync();