/**
 * Real-Time Module for LocalGreenChain
 *
 * Provides WebSocket-based real-time updates using Socket.io
 * with automatic fallback to SSE.
 */

// Types
export type {
  RoomType,
  ConnectionStatus,
  SocketAuthPayload,
  SocketHandshake,
  ClientToServerEvents,
  ServerToClientEvents,
  InterServerEvents,
  SocketData,
  RealtimeNotification,
  ConnectionMetrics,
  LiveFeedItem,
  TransparencyEventType,
  EventPriority,
  TransparencyEvent,
} from './types';

// Events
export {
  EventCategory,
  RealtimeEvent,
  EVENT_CATEGORIES,
  EVENT_DISPLAY,
  getEventCategory,
  getEventDisplay,
  formatEventDescription,
  toFeedItem,
  getEventsByCategory,
  isEventInCategory,
  priorityToNumber,
  sortEvents,
} from './events';

// Rooms
export {
  parseRoom,
  createRoom,
  getDefaultRooms,
  getCategoryRoom,
  getEventRooms,
  isValidRoom,
  canJoinRoom,
  ROOM_LIMITS,
} from './rooms';

// Server
export {
  RealtimeSocketServer,
  getSocketServer,
} from './socketServer';

// Client
export {
  RealtimeSocketClient,
  getSocketClient,
  createSocketClient,
} from './socketClient';
export type {
  SocketClientConfig,
  EventListener,
  StatusListener,
  ErrorListener,
} from './socketClient';

// React Hooks
export {
  useSocket,
  useLiveFeed,
  usePlantUpdates,
  useFarmUpdates,
  useConnectionStatus,
  useEventCount,
} from './useSocket';
export type {
  UseSocketOptions,
  UseSocketReturn,
} from './useSocket';

// React Context
export {
  SocketProvider,
  useSocketContext,
  useOptionalSocketContext,
} from './SocketContext';
