Skip to content

Commit

Permalink
fix: update d.ts (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariodu authored and fengmk2 committed Aug 22, 2019
1 parent d5c17a7 commit 19884ff
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions lib/address.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
namespace address {
function ip(interfaceName?: string): string
export = address;

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
declare interface Address {
p: string;
ipv6: string;
mac: string;
}

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
declare type AddressCallback = (err: Error, addr: Address) => void;
declare type MacCallback = (err: Error, addr: string) => void;
declare type DnsCallback = (err: Error, servers: string[]) => void;

declare function address(interfaceName: string | AddressCallback, callback?: AddressCallback): void;

export = address
declare namespace address {
const MAC_IP_RE: RegExp;
const MAC_RE: RegExp;

function dns(filepath: string | DnsCallback, callback?: DnsCallback): void;
function ip(interfaceName?: string): any;
function ipv6(interfaceName?: string): any;
function mac(interfaceName: string | MacCallback, callback?: MacCallback): void;
}

0 comments on commit 19884ff

Please sign in to comment.