export type NextFn = () => Promise | any; /** * Final handler is called when the entire chain has been * executed successfully. */ export type FinalHandler = () => Promise; /** * Error handler is called any method in the pipeline raises * an exception */ export type ErrorHandler = (error: any) => Promise; /** * The executor function that invokes the middleware */ export type Executor = (middleware: MiddlewareFn, next: NextFn) => Promise;