import { Context } from './context'; import { Route } from './route'; /** * Handler type takes the In and Out parameters. * * @param In is the value of the previous handler, which will be inside * `HandlerContext.data`. * @param Out is the return value of the handler. */ export type Handler = (context: HandlerContext, controller: AbortController) => Out | Promise; /** * HandlerContext is the context passed to the handler. * It contains the current route and the data from the previous handler. */ export interface HandlerContext extends Context { readonly data: T; readonly route: Route; } /** * Execute route handlers sequentially, with cancellation support * @param handlers handlers to execute * @param context current context * @param controller abort controller * @returns {Promise} */ export declare function handle(handlers: Route['handlers'], context: Context, controller: AbortController): Promise; //# sourceMappingURL=handler.d.ts.map