/** * Standalone Server * * Standalone HTTP server for UI Bridge that can run independently. * Supports both HTTP and WebSocket connections. */ import type { UIBridgeServerConfig, UIBridgeServerHandlers, WebSocketMessage } from './types'; import { UIBridgeWSHandler } from './websocket-handler'; import type { BridgeEvent } from '@qontinui/ui-bridge'; /** * Standalone server configuration */ export interface StandaloneServerConfig extends UIBridgeServerConfig { /** Host to bind to */ host?: string; /** Port to listen on */ port?: number; /** Enable WebSocket support */ websocket?: boolean; /** WebSocket port (defaults to port) */ websocketPort?: number; /** Logging function */ log?: (message: string) => void; } /** * Simple HTTP server implementation using Node.js built-in http module * with optional WebSocket support. */ export declare class StandaloneServer { private server; private wsServer; private config; private handlers; private wsHandler; private wsConnections; constructor(handlers: UIBridgeServerHandlers, config?: StandaloneServerConfig); /** * Start the server */ start(): Promise; /** * Start WebSocket server */ private startWebSocketServer; /** * Stop the server */ stop(): Promise; /** * Handle an HTTP request */ private handleRequest; /** * Find a matching route */ private findRoute; /** * Extract params from path */ private extractParams; /** * Parse request body */ private parseBody; /** * Send JSON response */ private sendJSON; /** * Broadcast a message to all WebSocket connections (legacy) */ broadcast(message: WebSocketMessage): void; /** * Broadcast an event to all subscribed WebSocket clients */ broadcastEvent(event: BridgeEvent): void; /** * Get WebSocket handler for direct access */ getWSHandler(): UIBridgeWSHandler | null; /** * Get number of connected WebSocket clients */ get wsClientCount(): number; /** * Get the server address */ getAddress(): { host: string; port: number; } | null; } /** * Create and start a standalone server */ export declare function createStandaloneServer(handlers: UIBridgeServerHandlers, config?: StandaloneServerConfig): Promise; /** * CLI entry point */ export declare function startCLI(handlers: UIBridgeServerHandlers, args?: string[]): Promise; //# sourceMappingURL=standalone.d.ts.map