UNPKG

1.09 kBTypeScriptView Raw
1import { ExpressRequestHandler, Request } from '@loopback/express';
2import { OpenApiSpec } from '@loopback/openapi-v3';
3import express from 'express';
4import { PathParams } from 'express-serve-static-core';
5import { ServeStaticOptions } from 'serve-static';
6import { ResolvedRoute } from './route-entry';
7import { RouterSpec } from './router-spec';
8/**
9 * A registry of external, Express-style routes. These routes are invoked
10 * _after_ no LB4 route (controller or handler based) matched the incoming
11 * request.
12 *
13 * @internal
14 */
15export declare class ExternalExpressRoutes {
16 protected _externalRoutes: express.Router;
17 protected _staticRoutes: express.Router;
18 protected _specForExternalRoutes: RouterSpec;
19 get routerSpec(): RouterSpec;
20 registerAssets(path: PathParams, rootDir: string, options?: ServeStaticOptions): void;
21 mountRouter(basePath: string, router: ExpressRequestHandler, spec?: RouterSpec): void;
22 find(request: Request): ResolvedRoute;
23}
24export declare function rebaseOpenApiSpec<T extends Partial<OpenApiSpec>>(spec: T, basePath: string): T;