From e0b0ee2176a4dc5a8914a3fb094ec16b4966a740 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 4 Jan 2023 18:57:31 +0100 Subject: [PATCH] More import type usage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 32 +++++++++---------- src/charging-station/ChargingStationWorker.ts | 2 +- src/charging-station/MessageChannelUtils.ts | 4 +-- .../ocpp/OCPPRequestService.ts | 6 ++-- .../ui-server/AbstractUIServer.ts | 12 +++---- .../ui-server/UIHttpServer.ts | 12 +++---- src/worker/WorkerFactory.ts | 4 +-- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index c4d9abb6..6e35d864 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -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'; diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 66f557d6..d0324075 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -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'; diff --git a/src/charging-station/MessageChannelUtils.ts b/src/charging-station/MessageChannelUtils.ts index 9bf283d5..77adae8e 100644 --- a/src/charging-station/MessageChannelUtils.ts +++ b/src/charging-station/MessageChannelUtils.ts @@ -1,6 +1,6 @@ import { - ChargingStationData, - ChargingStationWorkerMessage, + type ChargingStationData, + type ChargingStationWorkerMessage, ChargingStationWorkerMessageEvents, } from '../types/ChargingStationWorker'; import type { Statistics } from '../types/Statistics'; diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 839e3995..f1a05dd5 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -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( + public abstract requestHandler( chargingStation: ChargingStation, commandName: RequestCommand, commandParams?: JsonType, params?: RequestParams - ): Promise; + ): Promise; } diff --git a/src/charging-station/ui-server/AbstractUIServer.ts b/src/charging-station/ui-server/AbstractUIServer.ts index 596ddb59..cc1f82f5 100644 --- a/src/charging-station/ui-server/AbstractUIServer.ts +++ b/src/charging-station/ui-server/AbstractUIServer.ts @@ -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'; diff --git a/src/charging-station/ui-server/UIHttpServer.ts b/src/charging-station/ui-server/UIHttpServer.ts index 223c5bbb..60bd7fdc 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -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'; diff --git a/src/worker/WorkerFactory.ts b/src/worker/WorkerFactory.ts index d979990c..668d447a 100644 --- a/src/worker/WorkerFactory.ts +++ b/src/worker/WorkerFactory.ts @@ -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'; -- 2.34.1