Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
16 lines
932 B
Plaintext
16 lines
932 B
Plaintext
import { Env, ErrorHandler, Next, NotFoundHandler } from "./types.js";
|
|
import { Context } from "./context.js";
|
|
//#region src/compose.d.ts
|
|
/**
|
|
* Compose middleware functions into a single function based on `koa-compose` package.
|
|
*
|
|
* @template E - The environment type.
|
|
*
|
|
* @param {[[Function, unknown], unknown][] | [[Function]][]} middleware - An array of middleware functions and their corresponding parameters.
|
|
* @param {ErrorHandler<E>} [onError] - An optional error handler function.
|
|
* @param {NotFoundHandler<E>} [onNotFound] - An optional not-found handler function.
|
|
*
|
|
* @returns {(context: Context, next?: Next) => Promise<Context>} - A composed middleware function.
|
|
*/
|
|
export declare const compose: <E extends Env = Env>(middleware: [[Function, unknown], unknown][] | [[Function]][], onError?: ErrorHandler<E>, onNotFound?: NotFoundHandler<E>) => ((context: Context, next?: Next) => Promise<Context>);
|
|
//#endregion |