///
import { Client, Response } from '.';
import * as https from 'https';
import { CookieSerializeOptions } from 'cookie';
import { Plugin } from './Plugin';
export interface RouterSettings {
controllers: string;
middleware: string;
routes: string;
}
export interface ViewSettings {
path: string;
}
export interface AppSettings {
port: number;
name?: string;
env?: string;
session?: {
store?: 'file';
cookie?: CookieSerializeOptions;
};
https?: https.ServerOptions | false;
chunkSize?: number;
static?: string[];
locale?: string;
logs?: {
error?: {
path?: string;
maxSize?: number;
};
access?: {
path?: string;
maxSize?: number;
};
};
}
export interface DBMysqlSettings {
driver: string;
default?: boolean;
database: string;
username: string;
password: string;
hostname: string;
}
export interface DBSettings {
[key: string]: DBMysqlSettings;
}
export interface Connection {
id: string;
client: Client;
}
export declare class Server {
private static instance;
static app?: AppSettings;
private static _clients;
private static _plugins;
static readonly plugins: Plugin[];
static start(): Promise | undefined;
static stop(): void;
private static request;
private static _runMiddleware;
/**
* Sends a debug page that displays debug data.
* If the app is in production mode, a 500 error page will be sent.
*
* @static
* @param {Client} client
* @param {{ [key: string]: any }} data
* @returns
* @memberof Server
*/
static sendDebugPage(client: Client, data: {
[key: string]: any;
}): Promise;
/**
* Sets the error page that should be displayed if something were to go wrong in the request.
*
* @static
* @param {Client} client
* @param {number} code
* @param {{ [key: string]: any }} [data={}]
* @returns {Promise}
* @memberof Server
*/
static getErrorPage(client: Client, code: number, data?: {
[key: string]: any;
}): Promise;
private static send;
}