import { HotServer } from "./HotServer";
import { HotRouteMethod, HotEventMethod, IHotRouteMethod, ServerExecutionFunction, TestCaseFunction, TestCaseObject, ServerRequest } from "./HotRouteMethod";
import { HotClient } from "./HotClient";
import { HotLog } from "./HotLog";
/**
 * The route to use.
 */
export declare class HotRoute {
    /**
     * The server that maintains the connections.
     */
    connection: HotServer | HotClient;
    /**
     * The associated logger.
     */
    logger: HotLog;
    /**
     * The route.
     */
    route: string;
    /**
     * The description of the route.
     */
    description: string;
    /**
     * Additional OpenAPI information. Anything added here will be automerged in.
     */
    openAPI: any;
    /**
     * The version.
     */
    version: string;
    /**
     * The prefix to add to the beginning of each route method.
     */
    prefix: string;
    /**
     * The calls that can be made.
     */
    methods: HotRouteMethod[];
    /**
     * The errors and their JSON that can be thrown. Can be:
     * * not_authorized
     * * no_server_execute_function
     */
    errors: {
        [error: string]: any;
    };
    constructor(connection: HotServer | HotClient, route: string, methods?: HotRouteMethod[]);
    /**
     * Create an error JSON object.
     */
    static createError(message: string, errorCode?: number): any;
    /**
     * Add an API method to this route.
     *
     * @param method The name of the method to add. If a HotRouteMethod is supplied, the
     * rest of the arguments supplied will be ignored.
     */
    addMethod(method: HotRouteMethod | IHotRouteMethod | string, executeFunction?: ServerExecutionFunction, type?: HotEventMethod, testCases?: (string | TestCaseFunction)[] | TestCaseFunction[] | TestCaseObject[]): HotRouteMethod | IHotRouteMethod;
    /**
     * Get a method by it's name.
     */
    getMethod(name: string): HotRouteMethod;
    /**
     * Executes before all routes have been registered.
     */
    onPreRegister: () => Promise<void>;
    /**
     * Executes when first registering this route with Express. If
     * this returns false, the route will not be registered.
     */
    onRegister: () => Promise<boolean>;
    /**
     * Executes after all routes have been registered.
     */
    onPostRegister: () => Promise<void>;
    /**
     * Executes when authorizing a called method.
     * The value returned from here will be passed to onExecute in the
     * called HotRouteMethod. Undefined returning from here will mean
     * the authorization failed.
     */
    onAuthorizeUser: (req: ServerRequest) => Promise<any>;
}
//# sourceMappingURL=HotRoute.d.ts.map