| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // TYPES - Education Platform SSE Backend | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export type ReactionType = 'π' | 'β€οΈ' | 'π' | 'π' | 'π' | 'π' | 'π₯'; | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // SESSION TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface Session { | |
| id: string; | |
| name: string; | |
| description?: string; | |
| teacherId: string; | |
| teacherName: string; | |
| createdAt: string; | |
| isActive: boolean; | |
| totalSlides: number; | |
| slideUrls: string[]; | |
| studentCount: number; | |
| maxStudents: number; | |
| roomCode?: string; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // USER TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface User { | |
| id: string; | |
| name: string; | |
| role: 'teacher' | 'student'; | |
| sessionId?: string; | |
| joinedAt: string; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // CHAT TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface ChatMessage { | |
| id: string; | |
| sessionId: string; | |
| userId: string; | |
| userName: string; | |
| message: string; | |
| isTeacher: boolean; | |
| timestamp: string; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // POLL TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface PollOption { | |
| id: string; | |
| text: string; | |
| isCorrect?: boolean; | |
| votes: number; | |
| } | |
| export interface Poll { | |
| id: string; | |
| sessionId: string; | |
| question: string; | |
| options: PollOption[]; | |
| type: 'single' | 'multiple'; | |
| correctAnswer?: string; | |
| duration: number; | |
| createdAt: string; | |
| endsAt: string; | |
| isActive: boolean; | |
| results: Record<string, number>; | |
| totalVotes: number; | |
| votedStudents: string[]; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // DOUBT TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface Doubt { | |
| id: string; | |
| sessionId: string; | |
| studentId: string; | |
| studentName: string; | |
| question: string; | |
| image?: string; | |
| slideNumber: number; | |
| status: 'pending' | 'in_progress' | 'solved'; | |
| createdAt: string; | |
| solvedAt?: string; | |
| annotatedImage?: string; | |
| teacherResponse?: string; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // WHITEBOARD TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface WhiteboardStroke { | |
| id: string; | |
| tool: 'pen' | 'eraser' | 'highlighter'; | |
| color: string; | |
| lineWidth: number; | |
| points: { x: number; y: number }[]; | |
| timestamp: string; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // REACTION TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface Reaction { | |
| emoji: ReactionType; | |
| count: number; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // SLIDE TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface Slide { | |
| number: number; | |
| imageUrl?: string; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // SSE EVENT TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface SSEEvent { | |
| id: string; | |
| event: string; | |
| data: any; | |
| } | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| // API REQUEST/RESPONSE TYPES | |
| // βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| export interface ApiResponse<T = any> { | |
| success: boolean; | |
| data?: T; | |
| error?: string; | |
| message?: string; | |
| } | |
| // Session API | |
| export interface SessionCreateRequest { | |
| action: 'create'; | |
| teacherId: string; | |
| teacherName: string; | |
| sessionName: string; | |
| description?: string; | |
| slideUrls?: string[]; | |
| } | |
| export interface SessionJoinRequest { | |
| action: 'join'; | |
| sessionId: string; | |
| userId: string; | |
| userName: string; | |
| } | |
| export interface SessionEndRequest { | |
| action: 'end'; | |
| sessionId: string; | |
| } | |
| export interface SessionGetRequest { | |
| action: 'get'; | |
| sessionId: string; | |
| } | |
| export type SessionRequest = SessionCreateRequest | SessionJoinRequest | SessionEndRequest | SessionGetRequest; | |
| // Slide API | |
| export interface SlideNextRequest { | |
| action: 'next'; | |
| sessionId: string; | |
| } | |
| export interface SlidePrevRequest { | |
| action: 'prev'; | |
| sessionId: string; | |
| } | |
| export interface SlideUploadRequest { | |
| action: 'upload'; | |
| sessionId: string; | |
| slideImage: string; | |
| } | |
| export type SlideRequest = SlideNextRequest | SlidePrevRequest | SlideUploadRequest; | |
| // Poll API | |
| export interface PollCreateRequest { | |
| action: 'create'; | |
| sessionId: string; | |
| question: string; | |
| options: string[]; | |
| type?: 'single' | 'multiple'; | |
| correctAnswer?: string; | |
| duration?: number; | |
| } | |
| export interface PollVoteRequest { | |
| action: 'vote'; | |
| sessionId: string; | |
| pollId: string; | |
| option: string; | |
| studentId: string; | |
| } | |
| export interface PollEndRequest { | |
| action: 'end'; | |
| sessionId: string; | |
| pollId: string; | |
| } | |
| export type PollRequest = PollCreateRequest | PollVoteRequest | PollEndRequest; | |
| // Doubt API | |
| export interface DoubtCreateRequest { | |
| action: 'create'; | |
| sessionId: string; | |
| studentId: string; | |
| studentName: string; | |
| question: string; | |
| image?: string; | |
| slideNumber?: number; | |
| } | |
| export interface DoubtSolveRequest { | |
| action: 'solve'; | |
| sessionId: string; | |
| doubtId: string; | |
| annotatedImage?: string; | |
| teacherResponse?: string; | |
| } | |
| export type DoubtRequest = DoubtCreateRequest | DoubtSolveRequest; | |
| // Whiteboard API | |
| export interface WhiteboardDrawRequest { | |
| action: 'draw'; | |
| sessionId: string; | |
| tool: 'pen' | 'eraser' | 'highlighter'; | |
| color: string; | |
| lineWidth: number; | |
| points: { x: number; y: number }[]; | |
| } | |
| export interface WhiteboardClearRequest { | |
| action: 'clear'; | |
| sessionId: string; | |
| } | |
| export type WhiteboardRequest = WhiteboardDrawRequest | WhiteboardClearRequest; | |
| // React API | |
| export interface ReactRequest { | |
| sessionId: string; | |
| emoji: ReactionType; | |
| } | |
| // Chat API | |
| export interface ChatRequest { | |
| sessionId: string; | |
| userId: string; | |
| userName: string; | |
| message: string; | |
| isTeacher: boolean; | |
| } | |