| 1 | import { Server as HttpServer } from 'http'; |
| 2 | |
| 3 | import WebSocket from 'ws'; |
| 4 | |
| 5 | import { ChargingStationData } from '../../types/ChargingStationWorker'; |
| 6 | import { ProtocolVersion } from '../../types/UIProtocol'; |
| 7 | import AbstractUIService from './ui-services/AbstractUIService'; |
| 8 | |
| 9 | export abstract class AbstractUIServer { |
| 10 | public readonly chargingStations: Map<string, ChargingStationData>; |
| 11 | protected readonly uiServices: Map<ProtocolVersion, AbstractUIService>; |
| 12 | protected server: WebSocket.Server | HttpServer; |
| 13 | |
| 14 | public constructor() { |
| 15 | this.chargingStations = new Map<string, ChargingStationData>(); |
| 16 | this.uiServices = new Map<ProtocolVersion, AbstractUIService>(); |
| 17 | } |
| 18 | |
| 19 | public abstract start(): void; |
| 20 | public abstract stop(): void; |
| 21 | public abstract sendResponse(message: string): void; |
| 22 | public abstract logPrefix(modName?: string, methodName?: string): string; |
| 23 | } |