import React from 'react'; import { StyleProp, ViewStyle } from 'react-native'; import { Socket } from 'socket.io-client'; import { muteParticipants } from '../../methods/participantsMethods/muteParticipants'; import { messageParticipants } from '../../methods/participantsMethods/messageParticipants'; import { removeParticipants } from '../../methods/participantsMethods/removeParticipants'; import { CoHostResponsibility, EventType, Participant, ShowAlert } from '../../@types/types'; /** * Parameter bundle for `ParticipantsModal`, providing real-time participant state and helpers. * * @interface ParticipantsModalParameters * * **Participant State:** * @property {Participant[]} participants All known participants for the session. * @property {Participant[]} filteredParticipants Current participant collection after applying filters. * * **Role & Permissions:** * @property {CoHostResponsibility[]} coHostResponsibility Responsibility matrix dictating co-host abilities. * @property {string} coHost Username/ID of the acting co-host. * @property {string} member Current user identifier. * @property {string} islevel Current user level (host/co-host/member differentiation). * * **Session Context:** * @property {EventType} eventType Meeting type controlling available actions. * @property {Socket} socket Live socket.io connection for participant management. * @property {string} roomName Active room identifier. * @property {ShowAlert} [showAlert] Optional alerting callback for feedback. * * **Messaging Helpers:** * @property {(isVisible: boolean) => void} updateIsMessagesModalVisible Toggles direct message modal visibility. * @property {(participant: Participant | null) => void} updateDirectMessageDetails Sets context for direct messages. * @property {(start: boolean) => void} updateStartDirectMessage Toggles direct messaging flow. * @property {(participants: Participant[]) => void} updateParticipants Applies updates to the participant list. * * **Utility:** * @property {() => ParticipantsModalParameters} getUpdatedAllParams Retrieves latest parameter snapshot. * @property {Record} [key: string] Additional extension values consumed by overrides. */ export interface ParticipantsModalParameters { position?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'center'; backgroundColor?: string; coHostResponsibility: CoHostResponsibility[]; coHost: string; member: string; islevel: string; participants: Participant[]; eventType: EventType; filteredParticipants: Participant[]; socket: Socket; showAlert?: ShowAlert; roomName: string; updateIsMessagesModalVisible: (isVisible: boolean) => void; updateDirectMessageDetails: (participant: Participant | null) => void; updateStartDirectMessage: (start: boolean) => void; updateParticipants: (participants: Participant[]) => void; getUpdatedAllParams: () => ParticipantsModalParameters; [key: string]: any; } /** * Configuration options for the `ParticipantsModal` component. * * @interface ParticipantsModalOptions * * **Modal Control:** * @property {boolean} isParticipantsModalVisible Controls visibility. * @property {() => void} onParticipantsClose Invoked when the modal should close. * * **Participant Tools:** * @property {(filter: string) => void} onParticipantsFilterChange Updates the search query. * @property {number} participantsCounter Initial count badge displayed in the header. * @property {typeof muteParticipants} [onMuteParticipants=muteParticipants] Custom handler for muting selected participants. * @property {typeof messageParticipants} [onMessageParticipants=messageParticipants] Custom direct message handler. * @property {typeof removeParticipants} [onRemoveParticipants=removeParticipants] Custom removal handler. * * **Render Overrides:** * @property {React.ComponentType} [RenderParticipantList=ParticipantList] Component used for main participant rendering. * @property {React.ComponentType} [RenderParticipantListOthers=ParticipantListOthers] Component for overflow/other participants. * * **State Parameters:** * @property {ParticipantsModalParameters} parameters Parameter bundle providing helpers and state access. * * **Customization:** * @property {string} [backgroundColor='#83c0e9'] Modal surface color. * @property {'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'center'} [position='topRight'] Anchor position. * @property {StyleProp} [style] Additional styling applied to modal container. * * **Advanced Render Overrides:** * @property {(options: { defaultContent: JSX.Element; dimensions: { width: number; height: number } }) => JSX.Element} [renderContent] * Override to replace the default modal body content. * @property {(options: { defaultContainer: JSX.Element; dimensions: { width: number; height: number } }) => JSX.Element} [renderContainer] * Override to replace the modal container wrapper. */ export interface ParticipantsModalOptions { isParticipantsModalVisible: boolean; onParticipantsClose: () => void; onParticipantsFilterChange: (filter: string) => void; participantsCounter: number; onMuteParticipants?: typeof muteParticipants; onMessageParticipants?: typeof messageParticipants; onRemoveParticipants?: typeof removeParticipants; RenderParticipantList?: React.ComponentType; RenderParticipantListOthers?: React.ComponentType; parameters: ParticipantsModalParameters; backgroundColor?: string; position?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'center'; style?: StyleProp; renderContent?: (options: { defaultContent: JSX.Element; dimensions: { width: number; height: number; }; }) => JSX.Element; renderContainer?: (options: { defaultContainer: JSX.Element; dimensions: { width: number; height: number; }; }) => JSX.Element; } export type ParticipantsModalType = (options: ParticipantsModalOptions) => JSX.Element; /** * ParticipantsModal centralizes participant management actions—mute, message, remove—within a flexible * modal. It adapts to co-host permissions, supports direct messaging shortcuts, and offers render * overrides for tailor-made participant experiences. * * ### Key Features * - Real-time list synchronized through `parameters.getUpdatedAllParams`. * - Inline filtering with keyboard friendly TextInput. * - Built-in handlers for muting, messaging, and removal, all overrideable. * - Separate render components for primary and "others" participant lists. * - Corner anchoring and theming via `position` and `backgroundColor` props. * - Render overrides to swap container/content for custom UI frameworks. * * ### Accessibility * - Close button provides descriptive labels for assistive tech. * - Participant actions surface through Pressables, inheriting screen reader cues. * * @param {ParticipantsModalOptions} props Modal configuration options. * @returns {JSX.Element} Rendered participant management modal. * * @example Basic usage with default handlers. * ```tsx * * ``` * * @example Custom mute/message/remove handlers and styling. * ```tsx * * ``` * * @example Override participant list renderer for custom cards. * ```tsx * * ``` */ declare const ParticipantsModal: React.FC; export default ParticipantsModal;