Use eslint extension for import sorting instead of unmaintained external ones
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
CommitLineData
b153c0fd 1import { ListenOptions } from 'net';
8114d10e 2
9efbac5b 3import type { WorkerChoiceStrategy } from 'poolifier';
8114d10e
JB
4import { ServerOptions as WSServerOptions } from 'ws';
5
6import { StorageType } from './Storage';
a4624c96
JB
7import { WorkerProcessType } from './Worker';
8
b153c0fd 9export type ServerOptions = WSServerOptions & ListenOptions;
66271092 10
2dcfe98e
JB
11export enum SupervisionUrlDistribution {
12 ROUND_ROBIN = 'round-robin',
13 RANDOM = 'random',
14 SEQUENTIAL = 'sequential',
15}
16
1f5df42a 17export interface StationTemplateUrl {
e118beaa
JB
18 file: string;
19 numberOfStations: number;
20}
21
675fa8e3 22export interface UIServerConfiguration {
6a49ad23 23 enabled?: boolean;
66271092 24 options?: ServerOptions;
6a49ad23
JB
25}
26
72f041bd
JB
27export interface StorageConfiguration {
28 enabled?: boolean;
29 type?: StorageType;
1f5df42a 30 uri?: string;
72f041bd
JB
31}
32
cf2a5d9b
JB
33export interface WorkerConfiguration {
34 processType?: WorkerProcessType;
35 startDelay?: number;
36 elementsPerWorker?: number;
37 elementStartDelay?: number;
38 poolMinSize?: number;
39 poolMaxSize?: number;
40 poolStrategy?: WorkerChoiceStrategy;
41}
42
e118beaa 43export default interface ConfigurationData {
2dcfe98e
JB
44 supervisionUrls?: string | string[];
45 supervisionUrlDistribution?: SupervisionUrlDistribution;
1f5df42a 46 stationTemplateUrls: StationTemplateUrl[];
675fa8e3 47 uiServer?: UIServerConfiguration;
72f041bd 48 performanceStorage?: StorageConfiguration;
cf2a5d9b 49 worker?: WorkerConfiguration;
e118beaa 50 autoReconnectMaxRetries?: number;
cf2a5d9b 51 // deprecated
a4624c96 52 workerProcess?: WorkerProcessType;
cf2a5d9b 53 // deprecated
322c9192 54 workerStartDelay?: number;
cf2a5d9b 55 // deprecated
4bfd80fa 56 elementStartDelay?: number;
cf2a5d9b 57 // deprecated
a4624c96 58 workerPoolMinSize?: number;
cf2a5d9b 59 // deprecated
4fa59b8a 60 workerPoolMaxSize?: number;
cf2a5d9b 61 // deprecated
9efbac5b 62 workerPoolStrategy?: WorkerChoiceStrategy;
cf2a5d9b 63 // deprecated
5fdab605 64 chargingStationsPerWorker?: number;
72f041bd 65 logStatisticsInterval?: number;
e118beaa 66 logFormat?: string;
324fd4ee 67 logLevel?: string;
6bf6769e
JB
68 logRotate?: boolean;
69 logMaxFiles?: number;
e118beaa 70 logFile?: string;
7ec46a9a
JB
71 logErrorFile?: string;
72 logConsole?: boolean;
e118beaa 73}