/** * Returns the type of response middleware */ export declare type NextMiddlewareReturn = unknown; /** * Call the next middleware from the chain */ export declare type NextMiddleware = () => Promise; /** * Returns the type of response middleware */ export declare type MiddlewareReturn = unknown; /** * Instead of object */ export declare type UnknownObject = Record; /** * Basic middleware */ export declare type Middleware = (context: T, next: NextMiddleware) => MiddlewareReturn; /** * Asynchronous function for branch condition */ export declare type BranchMiddlewareConditionFunction = (context: T) => Promise | boolean; /** * Possible types for branch condition */ export declare type BranchMiddlewareCondition = BranchMiddlewareConditionFunction | boolean; /** * Asynchronous factory to create middleware */ export declare type LazyMiddlewareFactory = (context: T) => Promise> | Middleware; /** * Handler for catching errors in middleware chains */ export declare type CaughtMiddlewareHandler = (context: T, error: Error) => MiddlewareReturn;