/**
 * Port validation and management utilities
 * Handles port number validation and default port resolution
 */
import type { UnifiedConfig } from '../../config/unified-config-types';
/** Default CLIProxy port */
export declare const CLIPROXY_DEFAULT_PORT = 8317;
/**
 * Validate port is a valid positive integer (1-65535).
 * Returns default port if invalid.
 *
 * @param port - Port number to validate
 * @returns Valid port or CLIPROXY_DEFAULT_PORT (8317) if invalid
 */
export declare function validatePort(port: number | undefined): number;
/**
 * Validate and sanitize port number for remote connections.
 * Returns undefined for invalid ports (letting caller use default).
 * Valid range: 1-65535, must be integer.
 */
export declare function validateRemotePort(port: number | undefined): number | undefined;
/**
 * Get default port for remote CLIProxyAPI based on protocol.
 * - HTTP: 8317 (CLIProxyAPI default)
 * - HTTPS: 443 (standard SSL port)
 */
export declare function getRemoteDefaultPort(protocol: 'http' | 'https'): number;
/**
 * Normalize protocol to lowercase and validate.
 * Handles runtime case sensitivity (e.g., 'HTTPS' → 'https').
 * Defaults to 'http' for invalid values.
 */
export declare function normalizeProtocol(protocol: string | undefined): 'http' | 'https';
/**
 * Resolve the local CLIProxy lifecycle port from unified config.
 * Falls back to default port when unset, invalid, or unreadable.
 */
export declare function resolveLifecyclePort(config?: Pick<UnifiedConfig, 'cliproxy_server'>, loadConfig?: () => Pick<UnifiedConfig, 'cliproxy_server'>): number;
//# sourceMappingURL=port-manager.d.ts.map