Skip to content

Commit

Permalink
feat: Add typings (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieutu authored and fengmk2 committed Apr 24, 2019
1 parent f17f63e commit 7544592
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions lib/address.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace address {
function ip(interfaceName?: string): string

function ipv6(interfaceName?: string): string

function mac(callback: (err: Error, addr: string) => void): void
function mac(interfaceName: string, callback: (err: Error, addr: string) => void): void

function dns(callback: (err: Error, servers: string[]) => void): void
function dns(filePath: string, callback: (err: Error, servers: string[]) => void): void
}

function address(callback: (err: Error, addr: { ip: string, ipv6: string, mac: string }) => void): void
function address(interfaceName: string, callback: (err: Error, addr: { ip: string, ipv6: string, mac: string }) => void): void

export = address
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.3",
"description": "Get current machine IP, MAC and DNS servers.",
"main": "lib/address.js",
"types": "lib/address.d.ts",
"files": [
"lib"
],
Expand Down Expand Up @@ -43,4 +44,4 @@
},
"author": "fengmk2 <[email protected]>",
"license": "MIT"
}
}

0 comments on commit 7544592

Please sign in to comment.