UNPKG

1.05 kBTypeScriptView Raw
1import { Context, InvocationSource } from '@loopback/core';
2import { OperationObject } from '@loopback/openapi-v3';
3import { OperationArgs, OperationRetval } from '../types';
4import { RouteEntry } from './route-entry';
5/**
6 * Base implementation of RouteEntry
7 */
8export declare abstract class BaseRoute implements RouteEntry {
9 readonly path: string;
10 readonly spec: OperationObject;
11 readonly verb: string;
12 /**
13 * Construct a new route
14 * @param verb - http verb
15 * @param path - http request path pattern
16 * @param spec - OpenAPI operation spec
17 */
18 constructor(verb: string, path: string, spec: OperationObject);
19 abstract updateBindings(requestContext: Context): void;
20 abstract invokeHandler(requestContext: Context, args: OperationArgs): Promise<OperationRetval>;
21 describe(): string;
22 toString(): string;
23}
24export declare class RouteSource implements InvocationSource<RouteEntry> {
25 readonly value: RouteEntry;
26 type: string;
27 constructor(value: RouteEntry);
28 toString(): string;
29}