mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Update types for internal-ip to v3
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for internal-ip 3.0
|
||||
// Project: https://github.com/sindresorhus/internal-ip#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export const v6: IPGetterFn;
|
||||
export const v4: IPGetterFn;
|
||||
|
||||
export interface IPGetterFn { // tslint:disable-line:interface-name
|
||||
(): Promise<string | null>;
|
||||
sync(): string | null;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as internalIp from 'internal-ip';
|
||||
|
||||
internalIp.v6().then(ip => {
|
||||
// $ExpectType string | null
|
||||
ip;
|
||||
});
|
||||
// $ExpectType string | null
|
||||
internalIp.v6.sync();
|
||||
|
||||
internalIp.v4().then(ip => {
|
||||
// $ExpectType string | null
|
||||
ip;
|
||||
});
|
||||
// $ExpectType string | null
|
||||
internalIp.v4.sync();
|
||||
@@ -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",
|
||||
"internal-ip-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user