@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
27 lines • 852 B
TypeScript
/**
* Check if a port is available by attempting to bind to it
* Checks both IPv4 and IPv6
*/
export declare function isPortAvailable(port: number): Promise<boolean>;
/**
* Find an available port starting from the given port
* @param startPort - The port to start searching from
* @param maxAttempts - Maximum number of ports to try (default: 20)
* @throws Error if no available port is found within maxAttempts
*/
export declare function findAvailablePort(startPort: number, maxAttempts?: any): Promise<number>;
/**
* Find an available port within a specific range
*/
export declare function findAvailablePortInRange(range: PortRange): Promise<number>;
/**
* Default port for the dev server
*/
export declare const DEFAULT_PORT: 3000;
/**
* Port range configuration
*/
export declare interface PortRange {
start: number
end: number
}