address.d.ts 832 B

12345678910111213141516171819202122232425262728
  1. export = address;
  2. declare interface Address {
  3. ip: string;
  4. ipv6: string;
  5. mac: string;
  6. }
  7. declare type AddressCallback = (err: Error, addr: Address) => void;
  8. declare type MacCallback = (err: Error, addr: string) => void;
  9. declare type DnsCallback = (err: Error, servers: string[]) => void;
  10. declare function address(interfaceName: string, callback: AddressCallback): void;
  11. declare function address(callback: AddressCallback): void;
  12. declare namespace address {
  13. const MAC_IP_RE: RegExp;
  14. const MAC_RE: RegExp;
  15. function dns(filepath: string, callback: DnsCallback): void;
  16. function dns(callback: DnsCallback): void;
  17. function ip(interfaceName?: string): any;
  18. function ipv6(interfaceName?: string): any;
  19. function mac(interfaceName: string, callback: MacCallback): void;
  20. function mac(callback: MacCallback): void;
  21. }