| 30 | /** Middleware objects allow encapsulation of middleware along with the ability |
| 31 | * to initialize the middleware upon listen. */ |
| 32 | export interface MiddlewareObject< |
| 33 | S extends State = Record<string, any>, |
| 34 | T extends Context<S> = Context<S>, |
| 35 | > { |
| 36 | /** Optional function for delayed initialization which will be called when |
| 37 | * the application starts listening. */ |
| 38 | init?: () => Promise<unknown> | unknown; |
| 39 | /** The method to be called to handle the request. */ |
| 40 | handleRequest(context: T, next: Next): Promise<unknown> | unknown; |
| 41 | } |
| 42 | |
| 43 | /** Type that represents {@linkcode Middleware} or |
| 44 | * {@linkcode MiddlewareObject}. */ |
nothing calls this directly
no outgoing calls
no test coverage detected