feat(dev-ip): Add types for dev-ip (#29913)

This commit is contained in:
Mike Engel
2018-10-22 09:16:46 -07:00
committed by Sheetal Nandi
parent cbcc683dee
commit 98a045b99c
4 changed files with 41 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import devIp = require("dev-ip");
const ips = devIp();
function main() {
if (typeof ips === "boolean") {
return;
}
ips.map(ip => `ip: ${ip}`);
}
main();
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for dev-ip 1.0
// Project: https://github.com/shakyshane/dev-ip
// Definitions by: Mike Engel <https://github.com/mike-engel>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Returns either an array of IP addresses or false if none can be found (offline, etc)
*/
declare function devIp(): string[] | boolean;
export = devIp;
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "dev-ip-tests.ts"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }