import React from 'react'; import { StyleProp, ViewStyle, ImageStyle } from 'react-native'; import { Socket } from 'socket.io-client'; import { ControlsPosition, InfoPosition, Participant, ControlMediaOptions, AudioDecibels, CoHostResponsibility, ShowAlert, CustomAudioCardType } from '../../@types/types'; /** * Parameters consumed by `AudioCard` to reflect live meeting state and permissions. * * @interface AudioCardParameters * * **Telemetry & Participants:** * @property {AudioDecibels[]} audioDecibels Live loudness metrics per participant. * @property {Participant[]} participants Current participant roster. * * **Session Context:** * @property {Socket} socket Socket instance for media control events. * @property {CoHostResponsibility[]} coHostResponsibility Active co-host capabilities. * @property {string} roomName Active room identifier. * @property {ShowAlert} [showAlert] Optional alert helper. * @property {string} coHost Current co-host identifier. * @property {string} islevel Member privilege level. * @property {string} member Local member identifier. * @property {string} eventType Meeting event type (e.g., `conference`). * * **Helpers:** * @property {() => AudioCardParameters} getUpdatedAllParams Refreshes parameters before invoking side effects. */ export interface AudioCardParameters { audioDecibels: AudioDecibels[]; participants: Participant[]; socket: Socket; coHostResponsibility: CoHostResponsibility[]; roomName: string; showAlert?: ShowAlert; coHost: string; islevel: string; member: string; eventType: string; getUpdatedAllParams(): AudioCardParameters; } /** * Configuration options for rendering an `AudioCard`. * * @interface AudioCardOptions * * **Appearance:** * @property {StyleProp} [customStyle] Additional card styling. * @property {StyleProp} [style] Style override applied to the container wrapper. * @property {string} name Participant display name. * @property {string} [barColor='red'] Waveform bar color. * @property {string} [textColor='white'] Participant label color. * @property {string} [imageSource] Optional avatar URL. * @property {boolean} [roundedImage=false] Rounds avatar corners. * @property {StyleProp} [imageStyle] Additional avatar styling. * @property {string} [backgroundColor] Card background color. * * **Controls & Info:** * @property {boolean} [showControls=true] Toggles media controls visibility. * @property {boolean} [showInfo=true] Toggles participant info display. * @property {React.ReactNode} [videoInfoComponent] Replacement component for info overlay. * @property {React.ReactNode} [videoControlsComponent] Replacement component for controls overlay. * @property {ControlsPosition} [controlsPosition='topLeft'] Overlay placement for controls. * @property {InfoPosition} [infoPosition='bottomLeft'] Overlay placement for info. * * **Behaviour:** * @property {(options: ControlMediaOptions) => Promise} [controlUserMedia=controlMedia] Handler for toggling media. * @property {Participant} participant Participant metadata used in controls. * @property {AudioDecibels} [audioDecibels] Loudness metrics for the participant. * @property {AudioCardParameters} parameters Shared meeting parameters. * @property {CustomAudioCardType} [customAudioCard] Custom renderer to replace the default card body. * * **Advanced Render Overrides:** * @property {(options: { defaultContent: JSX.Element; dimensions: { width: number; height: number } }) => JSX.Element} [renderContent] * Override for the internal layout. * @property {(options: { defaultContainer: JSX.Element; dimensions: { width: number; height: number } }) => JSX.Element} [renderContainer] * Override for the outer container implementation. */ export interface AudioCardOptions { controlUserMedia?: (options: ControlMediaOptions) => Promise; customStyle?: StyleProp; name: string; barColor?: string; textColor?: string; imageSource?: string; roundedImage?: boolean; imageStyle?: StyleProp; showControls?: boolean; showInfo?: boolean; videoInfoComponent?: React.ReactNode; videoControlsComponent?: React.ReactNode; controlsPosition?: ControlsPosition; infoPosition?: InfoPosition; participant: Participant; backgroundColor?: string; audioDecibels?: AudioDecibels; parameters: AudioCardParameters; customAudioCard?: CustomAudioCardType; 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 AudioCardType = (options: AudioCardOptions) => JSX.Element; /** * AudioCard renders participant avatars, animated audio waveforms, and media controls within a * customizable card. It reacts to live audio telemetry, exposes override hooks, and integrates with * `controlMedia` for host-driven moderation. * * ### Key Features * - Animated waveform tied to decibel telemetry. * - Toggle buttons for audio/video with default or custom renderers. * - Supports image avatars or fallback initials via `MiniCard`. * - Aligns overlays via `controlsPosition` and `infoPosition` helpers. * * ### Accessibility * - Control buttons include iconography and can be wrapped in accessible containers. * - Text labels use high-contrast defaults for readability. * * @param {AudioCardOptions} props Audio card configuration. * @returns {JSX.Element} Rendered audio card. * * @example Standard host-controlled audio card. * ```tsx * * ``` * * @example Custom container with fade animation. * ```tsx * ( * {defaultContainer} * )} * /> * ``` */ declare const AudioCard: React.FC; export default AudioCard;