1 | import { UseMetadata } from '../../metadata/UseMetadata';
|
2 | import { MiddlewareMetadata } from '../../metadata/MiddlewareMetadata';
|
3 | import { ActionMetadata } from '../../metadata/ActionMetadata';
|
4 | import { Action } from '../../Action';
|
5 | import { ParamMetadata } from '../../metadata/ParamMetadata';
|
6 | import { BaseDriver } from '../BaseDriver';
|
7 |
|
8 |
|
9 |
|
10 | export declare class ExpressDriver extends BaseDriver {
|
11 | express?: any;
|
12 | constructor(express?: any);
|
13 | /**
|
14 | * Initializes the things driver needs before routes and middlewares registration.
|
15 | */
|
16 | initialize(): void;
|
17 | /**
|
18 | * Registers middleware that run before controller actions.
|
19 | */
|
20 | registerMiddleware(middleware: MiddlewareMetadata): void;
|
21 | /**
|
22 | * Registers action in the driver.
|
23 | */
|
24 | registerAction(actionMetadata: ActionMetadata, executeCallback: (options: Action) => any): void;
|
25 | /**
|
26 | * Registers all routes in the framework.
|
27 | */
|
28 | registerRoutes(): void;
|
29 | /**
|
30 | * Gets param from the request.
|
31 | */
|
32 | getParamFromRequest(action: Action, param: ParamMetadata): any;
|
33 | /**
|
34 | * Handles result of successfully executed controller action.
|
35 | */
|
36 | handleSuccess(result: any, action: ActionMetadata, options: Action): void;
|
37 | /**
|
38 | * Handles result of failed executed controller action.
|
39 | */
|
40 | handleError(error: any, action: ActionMetadata | undefined, options: Action): any;
|
41 | /**
|
42 | * Creates middlewares from the given "use"-s.
|
43 | */
|
44 | protected prepareMiddlewares(uses: UseMetadata[]): Function[];
|
45 | /**
|
46 | * Dynamically loads express module.
|
47 | */
|
48 | protected loadExpress(): void;
|
49 | /**
|
50 | * Dynamically loads body-parser module.
|
51 | */
|
52 | protected loadBodyParser(): any;
|
53 | /**
|
54 | * Dynamically loads multer module.
|
55 | */
|
56 | protected loadMulter(): any;
|
57 | }
|