import { FunctionMiddleware, ILogger, MidwayMiddlewareService } from '@midwayjs/core';
import { Context, NextFunction } from '@midwayjs/koa';
import { Resource } from '../entity';
import { MagicResourceService } from './core';
import { MagicApi } from './magic.api';
import { MagicDefinition } from './magic.provide';
export declare class MagicInterceptor implements MagicDefinition {
    type: string;
    magicResourceService: MagicResourceService;
    logger: ILogger;
    middlewareService: MidwayMiddlewareService<Context, NextFunction>;
    magicApi: MagicApi;
    private interceptorMap;
    private idInMappingPath;
    /**
     * 最终生成的拦截器数组
     */
    private cacheMiddlewares;
    init(reInit?: boolean): Promise<void>;
    /**
     * 添加拦截器
     * @param resource
     */
    add(resource: Resource): Promise<void>;
    /**
     * 删除拦截器
     * @param id
     */
    removeById(id: string): Promise<void>;
    /**
     * 拦截器变化时重新计算拦截器顺序
     */
    private calcCacheMiddleware;
    /**
     * 拦截器中间件
     */
    middleware(): FunctionMiddleware<Context, NextFunction>;
}
