/**
 * Socket Handler Functions
 *
 * This module provides pre-built socket handlers for common use cases
 * like echoing, proxying, HTTP responses, and redirects.
 */
import * as plugins from '../../../../plugins.js';
import type { IRouteConfig, TPortRange, IRouteContext } from '../../models/route-types.js';
/**
 * Pre-built socket handlers for common use cases
 */
export declare const SocketHandlers: {
    /**
     * Simple echo server handler
     */
    echo: (socket: plugins.net.Socket, context: IRouteContext) => void;
    /**
     * TCP proxy handler
     */
    proxy: (targetHost: string, targetPort: number) => (socket: plugins.net.Socket, context: IRouteContext) => void;
    /**
     * Line-based protocol handler
     */
    lineProtocol: (handler: (line: string, socket: plugins.net.Socket) => void) => (socket: plugins.net.Socket, context: IRouteContext) => void;
    /**
     * Simple HTTP response handler (for testing)
     */
    httpResponse: (statusCode: number, body: string) => (socket: plugins.net.Socket, context: IRouteContext) => void;
    /**
     * Block connection immediately
     */
    block: (message?: string) => (socket: plugins.net.Socket, context: IRouteContext) => void;
    /**
     * HTTP block response
     */
    httpBlock: (statusCode?: number, message?: string) => (socket: plugins.net.Socket, context: IRouteContext) => void;
    /**
     * HTTP redirect handler
     * Uses the centralized detection module for HTTP parsing
     */
    httpRedirect: (locationTemplate: string, statusCode?: number) => (socket: plugins.net.Socket, context: IRouteContext) => void;
    /**
     * HTTP server handler for ACME challenges and other HTTP needs
     * Uses the centralized detection module for HTTP parsing
     */
    httpServer: (handler: (req: {
        method: string;
        url: string;
        headers: Record<string, string>;
        body?: string;
    }, res: {
        status: (code: number) => void;
        header: (name: string, value: string) => void;
        send: (data: string) => void;
        end: () => void;
    }) => void) => (socket: plugins.net.Socket, context: IRouteContext) => void;
};
/**
 * Create a socket handler route configuration
 * @param domains Domain(s) to match
 * @param ports Port(s) to listen on
 * @param handler Socket handler function
 * @param options Additional route options
 * @returns Route configuration object
 */
export declare function createSocketHandlerRoute(domains: string | string[], ports: TPortRange, handler: (socket: plugins.net.Socket) => void | Promise<void>, options?: {
    name?: string;
    priority?: number;
    path?: string;
}): IRouteConfig;
