import type { Scope } from 'harper'; /** A Connect-style middleware: forwards to `next()` when it does not handle the request. */ export type Middleware = (req: any, res: any, next: (err?: unknown) => void) => void; /** * Compose Connect middlewares into one. Each runs only after the previous calls `next()` without an * error; the first to handle the response (by not calling `next`) ends the chain. When all fall through, * the composed middleware calls its own `next`. Lets us run, say, an auth check ahead of Vite. */ export declare function chain(...middlewares: Middleware[]): Middleware; /** A request that should receive an HTML document (SPA shell / SSR render) rather than falling through. */ export declare function acceptsHtml(req: any): boolean; /** * Register an HTTP handler with Harper that runs `middleware` first and, for any request the middleware * does not handle, falls through to the next Harper layer (e.g. `rest: true` resources) via `nextLayer`. */ export declare function registerHttp(scope: Scope, middleware: Middleware, options?: Record): void; /** Close the given instance both when the scope closes and when Harper broadcasts a shutdown message. */ export declare function registerShutdown(scope: Scope, close: () => unknown): void;