/// import type { HttpConnection } from './HttpConnection'; import type { HttpResponseCompleted } from './HttpResponse'; import type { HttpMethod } from './utils'; import type { Has } from '@principia/base/Has'; import type { FIO, IO } from '@principia/base/IO'; import type { URL } from 'url'; import * as Ev from '@principia/base/Eval'; import * as FR from '@principia/base/FiberRef'; import * as FL from '@principia/base/FreeList'; import { HttpException } from './HttpException'; export declare type RouteFn = (conn: HttpConnection, next: FIO) => IO; export declare class Empty { readonly R: (_: R) => void; readonly E: () => E; readonly _tag = "Empty"; } export declare class Route { readonly method: HttpMethod; readonly path: string; readonly route: RouteFn; readonly middlewares: FL.FreeList>; readonly _tag = "Route"; readonly R: (_: R) => void; readonly E: () => E; readonly match: (method: HttpMethod, url: URL) => boolean; constructor(method: HttpMethod, path: string, route: RouteFn, middlewares?: FL.FreeList>); middleware(): ReadonlyArray>; } export declare class Combine { readonly left: Routes; readonly right: Routes; readonly _tag = "Combine"; constructor(left: Routes, right: Routes); } export declare type Routes = Route | Combine | Empty; export declare type MiddlewareFn = (cont: RouteFn) => (conn: HttpConnection, next: FIO) => IO; export declare class Middleware { readonly apply: MiddlewareFn; constructor(apply: MiddlewareFn); } export declare const empty: Routes; export declare function _route(method: HttpMethod, path: string, handler: (conn: HttpConnection, n: IO) => IO & R1, E1, HttpResponseCompleted>): (routes: Routes) => Routes; export declare function route(method: HttpMethod, path: string, handler: (conn: HttpConnection) => IO & R, E, HttpResponseCompleted>): (routes: Routes) => Routes; export declare function middlewareSafe(routes: Routes, middle: (cont: RouteFn) => (conn: HttpConnection, next: FIO) => IO): Ev.Eval>; export declare function middleware_(routes: Routes, middle: (cont: RouteFn) => (conn: HttpConnection, next: FIO) => IO): Routes; export declare function HttpExceptionHandler(routes: Routes): Routes>; export declare const isRouterDraining: FR.Runtime; export declare function drain(rs: Routes): IO & R, never, never>; //# sourceMappingURL=Route.d.ts.map