// Socket.IO Event Types
export interface SocketUser {
    id: number;
    name: string;
    email?: string;
    avatar?: string;
}

export interface NotificationPayload {
    userId: string | number;
    action: string;
    message: string;
    action_url?: string;
    user_image?: string;
    data?: Record<string, any>;
}

export interface ForceLogoutPayload {
    userId: string | number;
    reason?: string;
}

// Socket Event Names
export enum SocketEvents {
    CONNECT = 'connect',
    DISCONNECT = 'disconnect',
    CONNECT_ERROR = 'connect_error',
    RECONNECT = 'reconnect',
    RECONNECT_ATTEMPT = 'reconnect_attempt',
    RECONNECT_ERROR = 'reconnect_error',
    RECONNECT_FAILED = 'reconnect_failed',
    
    // Custom events
    EMIT_NOTIFICATION = 'emitNotification',
    FORCE_LOGOUT = 'forceLogout',
}

// Socket Connection Status
export enum SocketStatus {
    CONNECTED = 'connected',
    DISCONNECTED = 'disconnected',
    CONNECTING = 'connecting',
    ERROR = 'error',
}

// Socket Context State
export interface SocketContextState {
    socket: Socket | null;
    status: SocketStatus;
    isConnected: boolean;
    error: Error | null;
}

// Import Socket type
import type { Socket } from 'socket.io-client';
