/// <reference types="koa" />
import { Context } from '@midwayjs/koa';
import { Resource } from '../entity';
import { MagicResourceService } from './core';
import { RouteSpec } from './joi.router';
import { MagicInterceptor } from './magic.interceptor';
import { MagicDefinition } from './magic.provide';
export declare class MagicApi implements MagicDefinition {
    type: string;
    /**
     * 路由
     * @private
     */
    private magicRouter;
    /**
     * 路由中间件
     * @private
     */
    private routerMiddleware;
    private logger;
    private magicConfig;
    magicResourceService: MagicResourceService;
    magicInterceptor: MagicInterceptor;
    init(reInit?: boolean): Promise<void>;
    /**
     * 拼接完整路径
     * @param path 路由路径
     * @private
     */
    private joinFullPath;
    /**
     * 路由中间件
     */
    middleware(): (context: Context, next: import("koa").Next, options?: any) => any;
    /**
     *添加路由
     * @param resource
     */
    add(resource: Resource): Promise<void>;
    /**
     * 删除路由
     * @param id 资源id
     */
    removeById(id: string): Promise<void>;
    /**
     * 获取路由定义
     * @param method 请求方式
     * @param path 请求路径
     */
    getRouterSpec(method: string, path: string): RouteSpec;
    /**
     * 生成定义
     */
    generateSpec(): any;
}
