import { configureStore } from '@reduxjs/toolkit'
import deviceSlice from './slices/deviceSlice'
import connectionSlice from './slices/connectionSlice'
import uiSlice from './slices/uiSlice'
import authSlice from './slices/authSlice'

/**
 * Redux Store 配置
 */
export const store = configureStore({
  reducer: {
    devices: deviceSlice,
    connection: connectionSlice,
    ui: uiSlice,
    auth: authSlice,
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: {
        ignoredActions: ['connection/setWebSocket'],
        ignoredPaths: ['connection.webSocket'],
      },
    }),
})

export type RootState = ReturnType<typeof store.getState>
export type AppDispatch = typeof store.dispatch 