import { Express } from "express"; import * as express from "express"; import * as nunjucks from "nunjucks"; import "reflect-metadata"; import * as multer from "multer"; import Config from "./config"; import BaseModule from "./base.module"; import ErrorController from "./error.controller"; import User from "./entities/user.entity"; import { APIResponseWrapper } from "./api-response-wrapper"; /** * Utility function to check if we are in the production environment. * @return true if the NODE_ENV is set to "production", false otherwise */ export declare function isProduction(): boolean; /** * Retrieve the preferred language from an express request, using the accepts-languages * header value. * @param req the express request * @return the two letter lower-cased language, or "*" (wildcard), or null */ export declare function getLanguageFromRequest(req: express.Request): string; export declare let app: App; /** * The App class contains the initialization code for a Lynx application. */ export default class App { express: Express; private readonly _config; private readonly _nunjucksEnvironment; private readonly _upload; private _templateMap; private _modules; private _errorController; apiResponseWrapper: APIResponseWrapper; readonly config: Config; readonly templateMap: any; readonly nunjucksEnvironment: nunjucks.Environment; readonly upload: multer.Instance; /** * This property allow the customization of the standard error controller. * You need to create the controller using its standard constructor: * new MyCustomErrorController(app) */ customErrorController: ErrorController; constructor(config: Config, modules?: BaseModule[]); private recursiveGenerateTemplateMap; private generateTemplateMap; private recursiveExecuteMigrations; /** * This method will execute the migrations. * By default, this method will be executed automatically during the app * startup. In some scenario, like hight-scalability, this behaviour could * be unwanted. Thus, it is possibly otherwise to explicitly call this method * in some other way (for example, connecting it to a standard http route). */ executeMigrations(): Promise; private loadTranslations; private loadMiddlewares; private loadControllers; startServer(port: number): void; route(name: string, parameters?: any): string; translate(str: string, req: express.Request): string; generateTokenForUser(user: User): string; } declare global { interface Array { serialize(): Array; removeHiddenField(field: string): void; addHiddenField(field: string): void; } }