import { ContextInterface } from '../Interface' ; import { RegisteredMiddlewareType } from './MiddlewareTypes' ; export abstract class AbstractMiddleware { abstract pass ( ctx ? , next ? ) ; public asCallback ( ) { const callback = ( context , next ) => this . pass ( context , next ) ; callback . _name = this . constructor . name ; callback . _fromClass = this . constructor as typeof AbstractMiddleware ; return callback ; } }