import { IncomingMessage, ServerResponse } from 'http';

/** Incoming request with optional parsed body (attached by body parser). */
type Req = IncomingMessage & {
    body?: any;
};
type Res = ServerResponse;
type Next = () => void;

/**
 * Creates a single Connect-compatible middleware that handles:
 * - GET  /ping        → health check
 * - POST /edit-file   → cors + auth + edit handler
 * - OPTIONS /edit-file → CORS preflight
 */
declare function createMiddleware(): (req: Req, res: Res, next: Next) => void;

/**
 * Configures webpack-dev-server with visual editing middleware.
 * Registers /ping, /edit-file (POST + OPTIONS) endpoints.
 */
declare function setupDevServer(config: any): any;

export { createMiddleware, setupDevServer as default, setupDevServer };
