HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/myc/api-management/node_modules/get-port/index.d.ts
/// <reference types="node"/>
import {ListenOptions} from 'net';

declare namespace getPort {
	interface Options extends Omit<ListenOptions, 'port'> {
		/**
		A preferred port or an iterable of preferred ports to use.
		*/
		readonly port?: number | Iterable<number>;

		/**
		The host on which port resolution should be performed. Can be either an IPv4 or IPv6 address.
		*/
		readonly host?: string;
	}
}

declare const getPort: {
	/**
	Get an available TCP port number.

	@returns Port number.

	@example
	```
	import getPort = require('get-port');

	(async () => {
		console.log(await getPort());
		//=> 51402

		// Pass in a preferred port
		console.log(await getPort({port: 3000}));
		// Will use 3000 if available, otherwise fall back to a random port

		// Pass in an array of preferred ports
		console.log(await getPort({port: [3000, 3001, 3002]}));
		// Will use any element in the preferred ports array if available, otherwise fall back to a random port
	})();
	```
	*/
	(options?: getPort.Options): Promise<number>;

	/**
	Make a range of ports `from`...`to`.

	@param from - First port of the range. Must be in the range `1024`...`65535`.
	@param to - Last port of the range. Must be in the range `1024`...`65535` and must be greater than `from`.
	@returns The ports in the range.

	@example
	```
	import getPort = require('get-port');

	(async () => {
		console.log(await getPort({port: getPort.makeRange(3000, 3100)}));
		// Will use any port from 3000 to 3100, otherwise fall back to a random port
	})();
	```
	*/
	makeRange(from: number, to: number): Iterable<number>;
};

export = getPort;