import { Wrapper } from './Wrapper';
import { Callback, Middleware, Method, MiddlewareInstance, Routes, RouteId, MiddlewareId } from '../@types';
interface RouterConstructOpts {
    /**
     * indicating if parent middlewares should be inherited when it gets mounted, defaults to true.
     */
    inheritMiddlewares?: boolean;
    /**
     * defines routers base path
     */
    basePath?: string;
}
export declare class Router {
    private basePath;
    private routes;
    private middlewares;
    private inheritMiddlewares;
    /**
     *
     * @param inheritMiddlewares - boolean indicating if parent middlewares should be inherited, defaults to true.
     */
    constructor(opts?: RouterConstructOpts);
    /**
     * resolves the url route by joining it to the base path
     */
    private resolvePath;
    /**
     * resolves a route callback options
     */
    private resolveMiddlewares;
    /**
     * resolves a use middleware options
     */
    private resolveMethods;
    /**
     * sets the route rule for a given http method
     *
     * @param method - the http method
     * @param url - route url
     * @param callback - route callback handler
     * @param options - route configuration object or middleware or array of middlewares
     */
    private set;
    /**
     * returns the routes.
     */
    getRoutes(): Routes;
    /**
     * returns the middlewares
     */
    getMiddlewares(): MiddlewareInstance[];
    /**
     * returns routing base path that gets prepended to all route and middleware urls
     */
    getBasePath(): string;
    /**
     * sets routing base path that gets prepended to all route and middleware urls
     */
    setBasePath(basePath: string): this;
    /**
     * stores route rules for http OPTIONS method
     *
     * @param url - route url
     * @param callback - route callback handler
     * @param options - route configuration object or middleware or array of middlewares
     */
    options(path: string, callback: Callback, use?: Middleware | Middleware[]): RouteId;
    /**
     * stores route rules for http HEAD method
     *
     * @param url - route url
     * @param callback - route callback handler
     * @param options - route configuration object or middleware or array of middlewares
     */
    head(path: string, callback: Callback, use?: Middleware | Middleware[]): RouteId;
    /**
     * stores route rules for http GET method
     *
     * @param url - route url
     * @param callback - route callback handler
     * @param options - route configuration object or middleware or array of middlewares
     */
    get(path: string, callback: Callback, use?: Middleware | Middleware[]): RouteId;
    /**
     * stores route rules for http POST method
     *
     * @param url - route url
     * @param callback - route callback handler
     * @param options - route configuration object or middleware or array of middlewares
     */
    post(path: string, callback: Callback, use?: Middleware | Middleware[]): RouteId;
    /**
     * stores route rules for http PUT method
     *
     * @param url - route url
     * @param callback - route callback handler
     * @param options - route configuration object or middleware or array of middlewares
     */
    put(path: string, callback: Callback, use?: Middleware | Middleware[]): RouteId;
    /**
     * stores route rules for http DELETE method
     *
     * @param url - route url
     * @param callback - route callback handler
     * @param options - route configuration object or middleware or array of middlewares
     */
    delete(path: string, callback: Callback, use?: Middleware | Middleware[]): RouteId;
    /**
     * stores route rules for all http methods
     *
     * @param url - route url
     * @param callback - route callback handler
     * @param options - route configuration object or middleware or array of middlewares
     */
    any(path: string, callback: Callback, use?: Middleware | Middleware[]): RouteId;
    /**
     * creates and returns a route wrapper for the given url
     */
    route(url: string): Wrapper;
    /**
     * registers a middleware to be called whenever the given url is visited
     *
     * @param url - url to apply middleware to. use * to appy to all urls
     * @param middleware - the middleware or array of middlewares
     * @param options - middleware configuration option. here, you can specify the http method
     * that the middleware will run against
     *@returns {MiddlewareId} returns the middleware id, can be used to delete the middleware.
     */
    use(path: string, middleware: Middleware | Middleware[], operation?: Method | Method[]): MiddlewareId;
    /**
     * sets or gets the inherit parent's middlewares flag.
     * @param status - if given, it sets this value
     */
    shouldInheritMiddlewares(status?: boolean): boolean;
    /**
     * removes a given route
     * @param id route id
     */
    removeRoute(id: RouteId): boolean;
    /**
     * removes a given middleware. returns true if it succeeds, otherwise, it returns false
     * @param id middleware id
     */
    removeMiddleware(id: RouteId): boolean;
}
export {};
