@quasarbright/projection
Version:
A static site generator that creates a beautiful, interactive gallery to showcase your coding projects. Features search, filtering, tags, responsive design, and an admin UI.
43 lines • 1.63 kB
TypeScript
/**
* Utility for finding available ports
*/
/**
* Result of port finding operation
*/
export interface PortFinderResult {
/** The available port that was found */
port: number;
/** Whether the originally requested port was available */
wasRequested: boolean;
}
/**
* PortFinder provides utilities for finding available ports
*/
export declare class PortFinder {
/**
* Check if a specific port is available
*/
static isPortAvailable(port: number): Promise<boolean>;
/**
* Find an available port starting from the given port
*
* @param startPort - Port to start searching from
* @param maxAttempts - Maximum number of ports to try (default: 10)
* @returns The first available port found
* @throws Error if no available port is found within maxAttempts
*/
static findAvailablePort(startPort: number, maxAttempts?: number): Promise<number>;
/**
* Find a port with fallback behavior
*
* If userSuppliedPort is true and the port is not available, throws an error.
* If userSuppliedPort is false and the port is not available, tries to find the next available port.
*
* @param port - The desired port number
* @param userSuppliedPort - Whether the port was explicitly supplied by the user
* @returns PortFinderResult with the available port and whether it was the requested one
* @throws Error if userSuppliedPort is true and the port is not available
*/
static findPortWithFallback(port: number, userSuppliedPort: boolean): Promise<PortFinderResult>;
}
//# sourceMappingURL=port-finder.d.ts.map