/**
 * WebChat Channel Adapter
 *
 * Built-in HTTP/WebSocket chat server that provides a browser-based
 * chat interface. Serves a simple HTML UI and manages connected
 * WebSocket clients for real-time bidirectional messaging.
 *
 * No external dependencies required -- uses Node.js built-in
 * http module and the ws package (already a project dependency).
 */
import type { ChannelConfig, OutboundMessage, DeliveryResult } from '../index.js';
import { BaseChannel } from '../index.js';
/**
 * WebChat-specific configuration
 */
export interface WebChatConfig extends ChannelConfig {
    type: 'webchat';
    /** HTTP port to listen on (default: 3001) */
    port?: number;
    /** Host to bind to (default: '0.0.0.0') */
    host?: string;
    /** Allowed CORS origins (default: ['*']) */
    corsOrigins?: string[];
    /** Title displayed in the chat UI */
    title?: string;
    /** Maximum message length (default: 4096) */
    maxMessageLength?: number;
    /** Require authentication token for WebSocket connections */
    authToken?: string;
}
/**
 * WebChat channel -- built-in HTTP/WS chat server
 */
export declare class WebChatChannel extends BaseChannel {
    private server;
    private wss;
    private clients;
    private messageHistory;
    private maxHistory;
    constructor(config: WebChatConfig);
    private get webChatConfig();
    /**
     * Start the HTTP and WebSocket servers
     */
    connect(): Promise<void>;
    /**
     * Stop the servers and disconnect all clients
     */
    disconnect(): Promise<void>;
    /**
     * Send a message to a specific client or broadcast to all
     */
    send(message: OutboundMessage): Promise<DeliveryResult>;
    /**
     * Get number of connected clients
     */
    getClientCount(): number;
    /**
     * Get connected client IDs
     */
    getClientIds(): string[];
    /**
     * Broadcast a system message to all clients
     */
    broadcastSystem(content: string): Promise<void>;
    /**
     * Handle incoming HTTP requests
     */
    private handleHttpRequest;
    /**
     * Handle a new WebSocket connection
     */
    private handleWsConnection;
    /**
     * Handle an incoming WebSocket chat message
     */
    private handleWsMessage;
    /**
     * Send welcome message and history to a newly connected client
     */
    private sendWelcome;
    /**
     * Broadcast a message to all clients except the sender
     */
    private broadcastExcept;
    /**
     * Add a message to the history ring buffer
     */
    private addToHistory;
    /**
     * Determine content type from message content
     */
    private determineContentType;
    /**
     * Generate the HTML for the chat interface
     */
    private getChatHtml;
    /**
     * Escape HTML entities
     */
    private escapeHtml;
}
export default WebChatChannel;
