import Wrapper from './Wrapper';
import { Callback, CallbackOptions, Middleware, Url, Method, MiddlewareOptions, Routes, RouteId, MiddlewareId } from '../@types';
export default class Router {
    private basePath;
    private routes;
    private middlewares;
    private inheritMiddlewares;
    /**
     *
     * @param inheritMiddlewares - boolean indicating if parent middlewares should be inherited.
     */
    constructor(inheritMiddlewares: boolean);
    /**
     * resolves the url route by joining it to the base path
     */
    private resolveUrl;
    /**
     * 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(): [number, string, Middleware<import("./Request").default, import("./Response").default>[], import("../@types").ResolvedMiddlewareOptions | null][];
    /**
     * 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(url: Url, callback: Callback, options?: Middleware | Middleware[] | CallbackOptions): 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(url: Url, callback: Callback, options?: Middleware | Middleware[] | CallbackOptions): 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(url: Url, callback: Callback, options?: Middleware | Middleware[] | CallbackOptions): 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(url: Url, callback: Callback, options?: Middleware | Middleware[] | CallbackOptions): 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(url: Url, callback: Callback, options?: Middleware | Middleware[] | CallbackOptions): 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(url: Url, callback: Callback, options?: Middleware | Middleware[] | CallbackOptions): 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
     */
    all(url: Url, callback: Callback, options?: Middleware | Middleware[] | CallbackOptions): 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(url: Url, middleware: Middleware | Middleware[], options?: Method | Method[] | MiddlewareOptions): MiddlewareId;
    /**
     * returns a boolean indicating if router inherits parent's middlewares when mounted
     * @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;
}
