2017-07-08 18:43:42 +08:00
|
|
|
import {ClientConfig} from "../public/ConfigClass";
|
2017-06-04 21:25:08 +08:00
|
|
|
export enum DatabaseType{
|
2017-06-12 05:33:47 +08:00
|
|
|
memory = 0, mysql = 1
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
|
|
|
export enum LogLevel {
|
2017-06-12 05:33:47 +08:00
|
|
|
error, warn, info, debug, verbose
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum ThumbnailProcessingLib{
|
|
|
|
Jimp = 0,
|
|
|
|
gm = 1,
|
|
|
|
sharp = 2
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface MySQLConfig {
|
2017-06-12 05:33:47 +08:00
|
|
|
host: string;
|
|
|
|
database: string;
|
|
|
|
username: string;
|
|
|
|
password: string;
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
|
|
|
export interface DataBaseConfig {
|
2017-06-12 05:33:47 +08:00
|
|
|
type: DatabaseType;
|
|
|
|
mysql?: MySQLConfig;
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
|
|
|
export interface ThumbnailConfig {
|
2017-06-12 05:33:47 +08:00
|
|
|
folder: string;
|
|
|
|
processingLibrary: ThumbnailProcessingLib;
|
|
|
|
qualityPriority: boolean;
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
2017-07-04 01:17:49 +08:00
|
|
|
export interface SharingConfig {
|
|
|
|
updateTimeout: number;
|
|
|
|
}
|
2017-06-04 21:25:08 +08:00
|
|
|
export interface ServerConfig {
|
2017-06-12 05:33:47 +08:00
|
|
|
port: number;
|
|
|
|
imagesFolder: string;
|
|
|
|
thumbnail: ThumbnailConfig;
|
|
|
|
database: DataBaseConfig;
|
|
|
|
enableThreading: boolean;
|
2017-07-04 01:17:49 +08:00
|
|
|
sharing: SharingConfig;
|
2017-07-16 16:59:28 +08:00
|
|
|
sessionTimeout: number
|
2017-07-18 05:12:12 +08:00
|
|
|
folderPreviewSize: number;
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
2017-07-08 18:43:42 +08:00
|
|
|
export interface IPrivateConfig {
|
|
|
|
Server: ServerConfig;
|
2017-07-15 18:47:11 +08:00
|
|
|
Client: ClientConfig.Config;
|
2017-07-08 18:43:42 +08:00
|
|
|
}
|