mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #31343 from BendingBender/default-gateway
Add types for default-gateway
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import * as defaultGateway from 'default-gateway';
|
||||
|
||||
defaultGateway.v4().then(result => {
|
||||
result; // $ExpectType Gateway
|
||||
});
|
||||
defaultGateway.v6().then(result => {
|
||||
result; // $ExpectType Gateway
|
||||
});
|
||||
|
||||
defaultGateway.v4.sync(); // $ExpectType Gateway
|
||||
defaultGateway.v6.sync(); // $ExpectType Gateway
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for default-gateway 3.0
|
||||
// Project: https://github.com/silverwind/default-gateway#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export const v4: DefaultGatewayFn;
|
||||
export const v6: DefaultGatewayFn;
|
||||
|
||||
export interface DefaultGatewayFn {
|
||||
(): Promise<Gateway>;
|
||||
sync(): Gateway;
|
||||
}
|
||||
|
||||
export interface Gateway {
|
||||
gateway: string;
|
||||
interface: string | null;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"default-gateway-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user