import type { Request, Response, NextFunction } from "express";
import type { IncomingMessage } from "node:http";
import type { Duplex } from "stream";
/**
 * Express middleware function type
 */
export type MiddlewareFunction = (req: Request, res: Response, next: NextFunction) => void;
/**
 * WebSocket upgrade function type
 */
export type WebSocketUpgradeFunction = (req: IncomingMessage, socket: Duplex, head: Buffer) => void;
/**
 * Extended Express middleware that includes WebSocket upgrade functionality
 */
export interface ProxyMiddleware extends MiddlewareFunction {
    /**
     * Handle WebSocket upgrade requests
     * @param req - The incoming request
     * @param socket - The socket connection
     * @param head - The first packet of the upgraded stream
     */
    upgrade: WebSocketUpgradeFunction;
    /**
     * The target host to proxy to:
     * e.g. "http://localhost:4000"
     */
    target: URL;
}
/**
 * Type guard to check if a middleware has WebSocket upgrade capability
 */
export declare function hasUpgrade(middleware: any): middleware is ProxyMiddleware;
