import { FunctionMiddleware } from '@midwayjs/core';
import { Context, NextFunction } from '@midwayjs/koa';
import * as Joi from 'joi';
import { RequestMethod } from '../interface';
export declare type OutputValidation = {
    body?: Joi.SchemaLike | undefined;
    headers?: Joi.SchemaLike | undefined;
};
export declare type ValidateOptions = {
    type?: 'form' | 'json' | 'multipart';
    header?: Joi.SchemaLike | undefined;
    query?: Joi.SchemaLike | undefined;
    params?: Joi.SchemaLike | undefined;
    body?: Joi.SchemaLike | undefined;
    files?: Joi.SchemaLike | undefined;
};
/**
 * 路由定义
 */
export declare type RouteSpec = {
    id: string;
    options: {
        [key: string]: string;
    };
    pre?: FunctionMiddleware<Context, NextFunction> | undefined;
    validate: ValidateOptions;
    meta?: any;
    method: RequestMethod;
    path: string;
    handler: FunctionMiddleware<Context, NextFunction>;
    output?: {
        [status: string | number]: OutputValidation;
    } | undefined;
};
/**
 * Joi路由
 */
export default class JoiRouter {
    routes: RouteSpec[];
    router: any;
    use(middleware: FunctionMiddleware<Context, NextFunction>): void;
    /**
     * Return koa middleware
     * @return {Function}
     * @api public
     */
    middleware(): FunctionMiddleware<Context, NextFunction>;
    /**
     * 添加路由
     * @param spec
     */
    addRouter(spec: RouteSpec): void;
    /**
     * 路由前缀
     * @param prefix
     */
    prefix(prefix: any): any;
}
