/**
 * @module HandlerExecutionChain
 * @description 拦截器执行链
 */
import ServletContext from '../http/ServletContext';
import HandlerInterceptor from './HandlerInterceptor';
export default class HandlerExecutionChain {
    private servletContext;
    private handler;
    /**
     * interceptor中断时的拦截器下标
     */
    private interceptorIndex;
    /**
     * 构造一个拦截器注册器
     */
    constructor(handler: object, servletContext: ServletContext);
    /**
     * 当前注册所有拦截器实例
     */
    private interceptors;
    /**
     * 获取当前执行链所有拦截器
     */
    getInterceptors(): HandlerInterceptor[];
    setInterceptors(interceptors: HandlerInterceptor[]): void;
    /**
     * 添加拦截器到当前调用链末尾
     * @param interceptor
     */
    addInterceptor(...interceptors: Array<HandlerInterceptor>): void;
    /**
     * 添加指定拦截器，到指定下标
     */
    addInterceptor2(index: number, interceptor: HandlerInterceptor): void;
    /**
     * 获取当前handler
     */
    getHandler(): object;
    /**
    * 在处理action前，进行请求预处理，通常可以用于编码、安全控制、权限校验
    * @returns { Promise }
    *   返回值：true表示继续流程（如调用下一个拦截器或处理器）；false表示流程中断（如登录检查失败），不会继续调用其他的拦截器或处理器，此时我们需要通过response来产生响应；
    */
    applyPreHandle(): Promise<boolean>;
    /**
     * 在处理完action后的拦截函数，可对执行完的接口进行处理
     * @param { any } result 执行action返回的结果
     */
    applyPostHandle(result: any): Promise<void>;
    /**
     * 在请求结束后的拦截器 （无论成功还是失败都会执行此拦截函数)
     * （这里可以用于进行资源清理之类的工作）
     * @param { any } ex 如果执行action出现异常时，此参数会有值
     */
    applyAfterCompletion(ex: any): Promise<void>;
}
