From d08da942339b86b2458ab06585e2f6e4ed30647b Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 24 Jan 2022 18:39:28 +0900 Subject: feat(unstable): add Deno.networkInterfaces (#13475) --- cli/dts/lib.deno.unstable.d.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'cli/dts') diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 74ba8d796..28ea314f3 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -103,6 +103,36 @@ declare namespace Deno { swapFree: number; } + /** The information of the network interface */ + export interface NetworkInterfaceInfo { + /** The network interface name */ + name: string; + /** The IP protocol version */ + family: "IPv4" | "IPv6"; + /** The IP address */ + address: string; + /** The netmask */ + netmask: string; + /** The IPv6 scope id or null */ + scopeid: number | null; + /** The CIDR range */ + cidr: string; + /** The MAC address */ + mac: string; + } + + /** **Unstable** new API. yet to be vetted. + * + * Returns an array of the network interface informations. + * + * ```ts + * console.log(Deno.networkInterfaces()); + * ``` + * + * Requires `allow-env` permission. + */ + export function networkInterfaces(): NetworkInterfaceInfo[]; + /** All possible types for interfacing with foreign functions */ export type NativeType = | "void" -- cgit v1.2.3