More import type usage
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 4 Jan 2023 17:57:31 +0000 (18:57 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 4 Jan 2023 17:57:31 +0000 (18:57 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/charging-station/ChargingStationWorker.ts
src/charging-station/MessageChannelUtils.ts
src/charging-station/ocpp/OCPPRequestService.ts
src/charging-station/ui-server/AbstractUIServer.ts
src/charging-station/ui-server/UIHttpServer.ts
src/worker/WorkerFactory.ts

index c4d9abb610f1dd8b73fa1b169a06078d2ff52f64..6e35d864741abb3ed0e09431d79f3a7cb9be6895 100644 (file)
@@ -40,30 +40,30 @@ import { MeterValue, MeterValueMeasurand } from '../types/ocpp/MeterValues';
 import { OCPPVersion } from '../types/ocpp/OCPPVersion';
 import {
   AvailabilityType,
-  BootNotificationRequest,
-  CachedRequest,
-  ErrorCallback,
-  HeartbeatRequest,
-  IncomingRequest,
+  type BootNotificationRequest,
+  type CachedRequest,
+  type ErrorCallback,
+  type HeartbeatRequest,
+  type IncomingRequest,
   IncomingRequestCommand,
-  MeterValuesRequest,
+  type MeterValuesRequest,
   RequestCommand,
-  ResponseCallback,
-  StatusNotificationRequest,
+  type ResponseCallback,
+  type StatusNotificationRequest,
 } from '../types/ocpp/Requests';
 import {
-  BootNotificationResponse,
-  ErrorResponse,
-  HeartbeatResponse,
-  MeterValuesResponse,
+  type BootNotificationResponse,
+  type ErrorResponse,
+  type HeartbeatResponse,
+  type MeterValuesResponse,
   RegistrationStatus,
-  Response,
-  StatusNotificationResponse,
+  type Response,
+  type StatusNotificationResponse,
 } from '../types/ocpp/Responses';
 import {
   StopTransactionReason,
-  StopTransactionRequest,
-  StopTransactionResponse,
+  type StopTransactionRequest,
+  type StopTransactionResponse,
 } from '../types/ocpp/Transaction';
 import { WSError, WebSocketCloseEventStatusCode } from '../types/WebSocket';
 import Configuration from '../utils/Configuration';
index 66f557d6913f7382791a7e864028ac2e14718588..d032407533830eb86554c29450f63bfb1923e273 100644 (file)
@@ -5,7 +5,7 @@ import { parentPort, workerData } from 'worker_threads';
 import { ThreadWorker } from 'poolifier';
 
 import type { ChargingStationWorkerData } from '../types/ChargingStationWorker';
-import { WorkerMessage, WorkerMessageEvents } from '../types/Worker';
+import { type WorkerMessage, WorkerMessageEvents } from '../types/Worker';
 import Utils from '../utils/Utils';
 import WorkerConstants from '../worker/WorkerConstants';
 import ChargingStation from './ChargingStation';
index 9bf283d5e9e7330c98fac544e16da12eebfb93f8..77adae8e5c44d7ef033c36a7c359db9b0c9ea44b 100644 (file)
@@ -1,6 +1,6 @@
 import {
-  ChargingStationData,
-  ChargingStationWorkerMessage,
+  type ChargingStationData,
+  type ChargingStationWorkerMessage,
   ChargingStationWorkerMessageEvents,
 } from '../types/ChargingStationWorker';
 import type { Statistics } from '../types/Statistics';
index 839e39955f9ec59d724f2615374d8c0e1cee52e8..f1a05dd54381f5e54bcc281d88a9304f0631350e 100644 (file)
@@ -16,7 +16,7 @@ import {
   RequestCommand,
   type RequestParams,
   type ResponseCallback,
-  ResponseType,
+  type ResponseType,
 } from '../../types/ocpp/Requests';
 import type { ErrorResponse, Response } from '../../types/ocpp/Responses';
 import Constants from '../../utils/Constants';
@@ -376,10 +376,10 @@ export default abstract class OCPPRequestService {
   }
 
   // eslint-disable-next-line @typescript-eslint/no-unused-vars
-  public abstract requestHandler<RequestType extends JsonType, ResponseType extends JsonType>(
+  public abstract requestHandler<ReqType extends JsonType, ResType extends JsonType>(
     chargingStation: ChargingStation,
     commandName: RequestCommand,
     commandParams?: JsonType,
     params?: RequestParams
-  ): Promise<ResponseType>;
+  ): Promise<ResType>;
 }
index 596ddb598d78bfb10dca5c076b395e059289ba87..cc1f82f5f9b34cdeae081794780a2ee6f5f97312 100644 (file)
@@ -6,12 +6,12 @@ import type { ChargingStationData } from '../../types/ChargingStationWorker';
 import type { UIServerConfiguration } from '../../types/ConfigurationData';
 import {
   AuthenticationType,
-  ProcedureName,
-  ProtocolRequest,
-  ProtocolResponse,
-  ProtocolVersion,
-  RequestPayload,
-  ResponsePayload,
+  type ProcedureName,
+  type ProtocolRequest,
+  type ProtocolResponse,
+  type ProtocolVersion,
+  type RequestPayload,
+  type ResponsePayload,
 } from '../../types/UIProtocol';
 import type AbstractUIService from './ui-services/AbstractUIService';
 import UIServiceFactory from './ui-services/UIServiceFactory';
index 223c5bbbff1664dc111b0e62508436c726168673..60bd7fdcce2216e465a2bb01c607dd98dbfea4f3 100644 (file)
@@ -5,12 +5,12 @@ import { StatusCodes } from 'http-status-codes';
 import BaseError from '../../exception/BaseError';
 import type { UIServerConfiguration } from '../../types/ConfigurationData';
 import {
-  ProcedureName,
-  Protocol,
-  ProtocolRequest,
-  ProtocolResponse,
-  ProtocolVersion,
-  RequestPayload,
+  type ProcedureName,
+  type Protocol,
+  type ProtocolRequest,
+  type ProtocolResponse,
+  type ProtocolVersion,
+  type RequestPayload,
   ResponseStatus,
 } from '../../types/UIProtocol';
 import logger from '../../utils/Logger';
index d979990c8edc5ae94375b31045b8143508b94a99..668d447a7f4c23a1574bbb2c8ffc50260eb910f9 100644 (file)
@@ -1,8 +1,8 @@
-import { Worker, isMainThread } from 'worker_threads';
+import { type Worker, isMainThread } from 'worker_threads';
 
 import type { PoolOptions } from 'poolifier';
 
-import { WorkerData, WorkerOptions, WorkerProcessType } from '../types/Worker';
+import { type WorkerData, type WorkerOptions, WorkerProcessType } from '../types/Worker';
 import type WorkerAbstract from './WorkerAbstract';
 import WorkerConstants from './WorkerConstants';
 import WorkerDynamicPool from './WorkerDynamicPool';