UNPKG

@celosiajs/core

Version:

CelosiaJS Core. A framework for REST API based on Express.js

10 lines (9 loc) 681 B
import { Logger } from 'winston'; import { CelosiaRequest, CelosiaResponse, EmptyObject, NextFunction } from '.'; declare abstract class Middleware<Request extends CelosiaRequest<any, any, any, any> = CelosiaRequest<any, any, any, any>, Response extends CelosiaResponse<any> = CelosiaResponse<any>, Input extends Record<string, any> = EmptyObject, Output extends Record<string, any> | EmptyObject = EmptyObject> { protected loggingSource: string; protected logger: Logger; constructor(loggingSource: string); abstract index(data: Input, request: Request, response: Response, next: NextFunction<Output | undefined>): any | Promise<any>; } export default Middleware;