UNPKG

matterbridge

Version:
69 lines 3.16 kB
/** * This file contains the network function. * * @file network.ts * @author Luca Liguori * @date 2024-02-17 * @version 1.0.0 * * Copyright 2024, 2025, 2026 Luca Liguori. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * Retrieves the IPv4 address of the first non-internal network interface. * @returns {string | undefined} The IPv4 address of the selected network interface, or undefined if not found. */ export declare function getIpv4InterfaceAddress(): string | undefined; /** * Retrieves the IPv6 address of the first non-internal network interface. * @returns {string | undefined} The IPv4 address of the selected network interface, or undefined if not found. */ export declare function getIpv6InterfaceAddress(): string | undefined; /** * Retrieves the mac address of the first non-internal network interface. * @returns {string | undefined} The IPv4 address of the selected network interface, or undefined if not found. */ export declare function getMacAddress(): string | undefined; /** * Logs the available network interfaces and their details. * @param {boolean} log - Whether to enable logging of network interface details. */ export declare function logInterfaces(debug?: boolean): void; /** * Resolves the given hostname to an IP address. * * @param {string} hostname - The hostname to resolve. * @param {0 | 4 | 6} [family=4] - The address family to use (0 for any, 4 for IPv4, 6 for IPv6). Default is 4. * @returns {Promise<string | null>} - A promise that resolves to the IP address or null if not found. * * @remarks * This function uses DNS lookup to resolve the hostname, which can take some time to complete. */ export declare function resolveHostname(hostname: string, family?: 0 | 4 | 6): Promise<string | null>; /** * Retrieves the version of an npm package from the npm registry. * * @param {string} packageName - The name of the npm package. * @param {string} [tag='latest'] - The tag of the package version to retrieve (default is 'latest'). * @param {number} [timeout=5000] - The timeout duration in milliseconds (default is 5000ms). * @returns {Promise<string>} A promise that resolves to the version string of the package. * @throws {Error} If the request fails or the tag is not found. */ export declare function getNpmPackageVersion(packageName: string, tag?: string, timeout?: number): Promise<string>; /** * Retrieves the path to the global Node.js modules directory. * @returns A promise that resolves to the path of the global Node.js modules directory. */ export declare function getGlobalNodeModules(): Promise<string>; //# sourceMappingURL=network.d.ts.map