1 | import { Express } from "express";
|
2 | import * as express from "express";
|
3 | import * as nunjucks from "nunjucks";
|
4 | import "reflect-metadata";
|
5 | import * as multer from "multer";
|
6 | import Config from "./config";
|
7 | import BaseModule from "./base.module";
|
8 | import ErrorController from "./error.controller";
|
9 | import User from "./entities/user.entity";
|
10 | import { APIResponseWrapper } from "./api-response-wrapper";
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare function isProduction(): boolean;
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export declare function getLanguageFromRequest(req: express.Request): string;
|
23 | export declare let app: App;
|
24 |
|
25 |
|
26 |
|
27 | export default class App {
|
28 | express: Express;
|
29 | httpServer: any;
|
30 | private readonly _config;
|
31 | private readonly _nunjucksEnvironment;
|
32 | private readonly _upload;
|
33 | private _templateMap;
|
34 | private _modules;
|
35 | private _errorController;
|
36 | apiResponseWrapper: APIResponseWrapper;
|
37 | get config(): Config;
|
38 | get templateMap(): any;
|
39 | get nunjucksEnvironment(): nunjucks.Environment;
|
40 | get upload(): multer.Instance;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | set customErrorController(ctrl: ErrorController);
|
47 | constructor(config: Config, modules?: BaseModule[]);
|
48 | private recursiveGenerateTemplateMap;
|
49 | private generateTemplateMap;
|
50 | private recursiveExecuteMigrations;
|
51 | /**
|
52 | * This method will execute the migrations.
|
53 | * By default, this method will be executed automatically during the app
|
54 | * startup. In some scenario, like hight-scalability, this behaviour could
|
55 | * be unwanted. Thus, it is possibly otherwise to explicitly call this method
|
56 | * in some other way (for example, connecting it to a standard http route).
|
57 | */
|
58 | executeMigrations(): Promise<void>;
|
59 | private loadTranslations;
|
60 | private loadMiddlewares;
|
61 | private loadControllers;
|
62 | startServer(port: number): void;
|
63 | route(name: string, parameters?: any): string;
|
64 | translate(str: string, req: express.Request): string;
|
65 | generateTokenForUser(user: User): string;
|
66 | }
|
67 | declare global {
|
68 | interface Array<T> {
|
69 | serialize(): Array<any>;
|
70 | removeHiddenField(field: string): void;
|
71 | addHiddenField(field: string): void;
|
72 | }
|
73 | }
|