UNPKG

1.15 kBTypeScriptView Raw
1/// <reference types="express" />
2import { ControllerSpec, PathObject } from '@loopback/openapi-v3';
3import { Request } from '../types';
4import { ControllerClass, ControllerFactory } from './controller-route';
5import { ExternalExpressRoutes } from './external-express-routes';
6import { RestRouter } from './rest-router';
7import { ResolvedRoute, RouteEntry } from './route-entry';
8/**
9 * Routing table
10 */
11export declare class RoutingTable {
12 private readonly _router;
13 private _externalRoutes?;
14 constructor(_router?: RestRouter, _externalRoutes?: ExternalExpressRoutes | undefined);
15 /**
16 * Register a controller as the route
17 * @param spec
18 * @param controllerCtor
19 * @param controllerFactory
20 */
21 registerController<T extends object>(spec: ControllerSpec, controllerCtor: ControllerClass<T>, controllerFactory?: ControllerFactory<T>): void;
22 /**
23 * Register a route
24 * @param route - A route entry
25 */
26 registerRoute(route: RouteEntry): void;
27 describeApiPaths(): PathObject;
28 /**
29 * Map a request to a route
30 * @param request
31 */
32 find(request: Request): ResolvedRoute;
33}