-export type JsonObject = { [K in string]?: JsonType }
+export type JsonObject = {
+ [K in string]?: (JsonObject | JsonPrimitive)[] | JsonObject | JsonPrimitive
+}
export type JsonPrimitive = boolean | null | number | string
-export type JsonType = JsonObject | JsonPrimitive | JsonType[]
+export type JsonType = (JsonObject | JsonPrimitive)[] | JsonObject | JsonPrimitive
</template>
<script setup lang="ts">
-import { ref, watch } from 'vue'
+import type { UUIDv4 } from 'ui-common'
-import type { UUIDv4 } from '@/types'
+import { ref, watch } from 'vue'
import Button from '@/components/buttons/Button.vue'
import {
import Button from '@/components/buttons/Button.vue'
import { convertToInt, resetToggleButtonState, ROUTE_NAMES, useUIClient } from '@/composables'
-import { type OCPPVersion } from '@/types'
+import { type OCPPVersion } from '@/types/ChargingStationType'
const props = defineProps<{
chargingStationId: string
<script setup lang="ts">
import { useToast } from 'vue-toast-notification'
-import type { ConnectorStatus, OCPPVersion, Status } from '@/types'
+import type { ConnectorStatus, OCPPVersion, Status } from '@/types/ChargingStationType'
import Button from '@/components/buttons/Button.vue'
import StateButton from '@/components/buttons/StateButton.vue'
import { computed } from 'vue'
import { useToast } from 'vue-toast-notification'
-import type { ChargingStationData, ConnectorEntry, Status } from '@/types'
+import type { ChargingStationData, ConnectorEntry, Status } from '@/types/ChargingStationType'
import Button from '@/components/buttons/Button.vue'
import StateButton from '@/components/buttons/StateButton.vue'
</template>
<script setup lang="ts">
-import type { ChargingStationData } from '@/types'
+import type { ChargingStationData } from '@/types/ChargingStationType'
import CSData from '@/components/charging-stations/CSData.vue'
-import { createBrowserWsAdapter, WebSocketClient, type WebSocketFactory } from 'ui-common'
+import {
+ AuthenticationType,
+ createBrowserWsAdapter,
+ ProcedureName,
+ type RequestPayload,
+ type ResponsePayload,
+ ResponseStatus,
+ ServerNotification,
+ WebSocketClient,
+ type WebSocketFactory,
+} from 'ui-common'
import { useToast } from 'vue-toast-notification'
+import type { UIServerConfigurationSection } from '@/types/ConfigurationType'
+
import {
- ApplicationProtocol,
- AuthenticationType,
type ChargingStationOptions,
OCPP20IdTokenEnumType,
OCPP20TransactionEventEnumType,
type OCPP20TransactionEventRequest,
OCPPVersion,
- ProcedureName,
- type RequestPayload,
- type ResponsePayload,
- ResponseStatus,
- ServerNotification,
- type UIServerConfigurationSection,
-} from '@/types'
+} from '@/types/ChargingStationType'
+import { ApplicationProtocol } from '@/types/UIProtocol'
export class UIClient {
private static instance: null | UIClient = null
+import type { UUIDv4 } from 'ui-common'
import type { InjectionKey, Ref } from 'vue'
import { inject } from 'vue'
import { useToast } from 'vue-toast-notification'
-import type { ChargingStationData, ConfigurationData, UUIDv4 } from '@/types'
+import type { ChargingStationData } from '@/types/ChargingStationType'
+import type { ConfigurationData } from '@/types/ConfigurationType'
import {
EMPTY_VALUE_PLACEHOLDER,
import { type App as AppType, type Component, createApp, ref } from 'vue'
import ToastPlugin from 'vue-toast-notification'
-import type { ChargingStationData, ConfigurationData, UIServerConfigurationSection } from '@/types'
+import type { ChargingStationData } from '@/types/ChargingStationType'
+import type { ConfigurationData, UIServerConfigurationSection } from '@/types/ConfigurationType'
import App from '@/App.vue'
import {
+import type { JsonObject } from 'ui-common'
+
export enum AmpereUnits {
AMPERE = 'A',
CENTI_AMPERE = 'cA',
incomingCommands: Record<IncomingRequestCommand, boolean>
outgoingCommands?: Record<RequestCommand, boolean>
}
-
-// Local non-recursive JsonObject avoids Vue UnwrapRef<T> infinite instantiation (TS2589)
-type JsonObject = { [key in string]?: (JsonObject | JsonPrimitive)[] | JsonObject | JsonPrimitive }
-
-type JsonPrimitive = boolean | null | number | string
+++ /dev/null
-export type {
- ATGConfiguration,
- ATGEntry,
- ChargingStationData,
- ChargingStationInfo,
- ChargingStationOptions,
- ConnectorEntry,
- ConnectorStatus,
- EvseEntry,
- OCPP20TransactionEventRequest,
- Status,
-} from './ChargingStationType'
-export {
- OCPP16AvailabilityType,
- OCPP16ChargePointStatus,
- OCPP16RegistrationStatus,
- OCPP20IdTokenEnumType,
- OCPP20TransactionEventEnumType,
- OCPPVersion,
-} from './ChargingStationType'
-export type { ConfigurationData, UIServerConfigurationSection } from './ConfigurationType'
-export { ApplicationProtocol, Protocol, type SimulatorState } from './UIProtocol'
-export {
- AuthenticationType,
- type BroadcastChannelResponsePayload,
- type JsonObject,
- type JsonPrimitive,
- type JsonType,
- ProcedureName,
- type ProtocolNotification,
- type ProtocolRequest,
- type ProtocolRequestHandler,
- type ProtocolResponse,
- ProtocolVersion,
- type RequestPayload,
- type ResponsePayload,
- ResponseStatus,
- ServerNotification,
- type UUIDv4,
-} from 'ui-common'
</template>
<script setup lang="ts">
+import type { ResponsePayload, UUIDv4 } from 'ui-common'
+
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import { useToast } from 'vue-toast-notification'
-import type {
- ChargingStationData,
- ResponsePayload,
- SimulatorState,
- UIServerConfigurationSection,
- UUIDv4,
-} from '@/types'
+import type { ChargingStationData } from '@/types/ChargingStationType'
+import type { UIServerConfigurationSection } from '@/types/ConfigurationType'
+import type { SimulatorState } from '@/types/UIProtocol'
import StateButton from '@/components/buttons/StateButton.vue'
import ToggleButton from '@/components/buttons/ToggleButton.vue'
import CSConnector from '@/components/charging-stations/CSConnector.vue'
import { EMPTY_VALUE_PLACEHOLDER, useUIClient } from '@/composables'
-import { OCPP16ChargePointStatus } from '@/types'
+import { OCPP16ChargePointStatus } from '@/types/ChargingStationType'
import { toastMock } from '../setup'
import { createConnectorStatus, TEST_HASH_ID, TEST_STATION_ID } from './constants'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { UIClient } from '@/composables'
-import type { ChargingStationData } from '@/types'
+import type { ChargingStationData } from '@/types/ChargingStationType'
import CSConnector from '@/components/charging-stations/CSConnector.vue'
import CSData from '@/components/charging-stations/CSData.vue'
import { EMPTY_VALUE_PLACEHOLDER, useUIClient } from '@/composables'
-import { OCPPVersion } from '@/types'
+import { OCPPVersion } from '@/types/ChargingStationType'
import { toastMock } from '../setup'
import {
import { mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'
-import type { ChargingStationData } from '@/types'
+import type { ChargingStationData } from '@/types/ChargingStationType'
import CSTable from '@/components/charging-stations/CSTable.vue'
* simulator state display, CSTable visibility, UI server selector, and error handling.
*/
import { flushPromises, mount } from '@vue/test-utils'
+import { ResponseStatus } from 'ui-common'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { ref } from 'vue'
uiClientKey,
useUIClient,
} from '@/composables'
-import { ResponseStatus } from '@/types'
import ChargingStationsView from '@/views/ChargingStationsView.vue'
import { toastMock } from '../setup'
import StartTransaction from '@/components/actions/StartTransaction.vue'
import { useUIClient } from '@/composables'
-import { OCPPVersion } from '@/types'
+import { OCPPVersion } from '@/types/ChargingStationType'
import { toastMock } from '../setup'
import { TEST_HASH_ID, TEST_ID_TAG, TEST_STATION_ID } from './constants'
/* eslint-disable @typescript-eslint/no-non-null-assertion */
+import { AuthenticationType, ProcedureName, ResponseStatus, ServerNotification } from 'ui-common'
/**
* @file Tests for UIClient composable
* @description Unit tests for WebSocket client singleton, connection lifecycle,
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { UIClient } from '@/composables'
-import {
- AuthenticationType,
- OCPP20TransactionEventEnumType,
- OCPPVersion,
- ProcedureName,
- ResponseStatus,
- ServerNotification,
-} from '@/types'
+import { OCPP20TransactionEventEnumType, OCPPVersion } from '@/types/ChargingStationType'
import { toastMock } from '../setup'
import { createUIServerConfig, TEST_HASH_ID, TEST_ID_TAG } from './constants'
* @description Factory functions (NOT static objects) for ChargingStationData,
* ConnectorStatus, and other test fixtures. Using factories prevents shared state.
*/
+import { ProtocolVersion } from 'ui-common'
+
+import type { UIServerConfigurationSection } from '@/types/ConfigurationType'
+
import {
type ChargingStationData,
type ChargingStationInfo,
OCPP16ChargePointStatus,
OCPP16RegistrationStatus,
OCPPVersion,
- Protocol,
- ProtocolVersion,
- type UIServerConfigurationSection,
-} from '@/types'
+} from '@/types/ChargingStationType'
+import { Protocol } from '@/types/UIProtocol'
// ── Shared Test Constants ─────────────────────────────────────────────────────
* @description MockWebSocket, withSetup composable helper, mock factories.
*/
import { flushPromises } from '@vue/test-utils'
+import { ResponseStatus } from 'ui-common'
import { vi } from 'vitest'
import { type App, createApp } from 'vue'
-import { ResponseStatus } from '@/types'
-
export { flushPromises as flushAllPromises }
// ── MockUIClient ──────────────────────────────────────────────────────────────