node: Add scopeid for IPv6 interfaces

The scopeid field only exists if the interface is of family IPv6

https://nodejs.org/dist/latest-v6.x/docs/api/os.html#os_os_networkinterfaces
This commit is contained in:
Mattias Holmlund
2017-08-15 20:00:11 +02:00
parent d4f42ab007
commit 58ad862cee
+13 -2
View File
@@ -1379,14 +1379,25 @@ declare module "os" {
};
}
export interface NetworkInterfaceInfo {
export interface NetworkInterfaceInfoIPv4 {
address: string;
netmask: string;
family: string;
family: "IPv4";
mac: string;
internal: boolean;
}
export interface NetworkInterfaceInfoIPv6 {
address: string;
netmask: string;
family: "IPv6";
mac: string;
internal: boolean;
scopeid: number;
}
export type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
export function hostname(): string;
export function loadavg(): number[];
export function uptime(): number;