analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
52 lines • 1.47 kB
TypeScript
import { PROFILE_ROLES, type ChatApiClient } from '../types/chat';
/**
* Props for the Chat component
*/
export interface ChatProps {
/** API client for REST calls */
apiClient: ChatApiClient;
/** WebSocket URL for real-time messaging */
wsUrl: string;
/** JWT authentication token */
token: string;
/** Current user's userInstitutionId */
userId: string;
/** Current user's display name */
userName: string;
/** Current user's profile photo URL */
userPhoto?: string | null;
/** Current user's role */
userRole: PROFILE_ROLES;
/** Additional CSS classes */
className?: string;
/** Initial room ID to open (from URL) */
initialRoomId?: string;
/** Callback when room changes (for URL navigation) */
onRoomChange?: (roomId: string) => void;
/** Callback when returning to room list */
onBackToList?: () => void;
}
/**
* Main Chat component
*
* Provides complete chat functionality:
* - List of chat rooms
* - Create new chat rooms
* - Real-time messaging within rooms
*
* @example
* ```tsx
* <Chat
* apiClient={api}
* wsUrl="wss://api.example.com/chat/ws"
* token={authToken}
* userId={user.userInstitutionId}
* userName={user.name}
* userPhoto={user.photo}
* userRole="teacher"
* />
* ```
*/
export declare function Chat(props: Readonly<ChatProps>): import("react/jsx-runtime").JSX.Element;
export default Chat;
//# sourceMappingURL=Chat.d.ts.map