import { Client, Response } from '.'; import { Route } from '@red5/router'; declare type MiddlewareType = 'pre' | 'post' | 'terminate'; export interface Middleware { /** * Handles the request before the controller * * @param {client} client The client * @param {any[]} args Additional arguments * @returns {boolean | Response} */ handle?(client: Client, ...args: any[]): boolean | Response | Promise; /** * Handles the request after the controller * * @param {client} client The client * @param {any[]} args Additional arguments * @returns {boolean | Response} */ postHandle?(client: Client, ...args: any[]): boolean | Response; /** * Runs once the response is ready to be sent to the client */ terminate?(client: Client, ...args: any[]): void; } export declare class MiddlewareManager { static run(theRoute: Route, client: Client, type?: MiddlewareType): Promise; private static _runPreMiddleware; private static _runPostMiddleware; private static _runTerminateMiddleware; private static parseStringMiddleware; } export {};