atomicx-core sdk API 文档
atomicx-core sdk
atomicx-core sdk 是腾讯云最新推出的面向即时通信、音视频通话、视频直播、语聊房等场景的全新一代基于响应式的 API,您可以非常快速的在基于这组 API 构建自己的 UI 页面,它支持房间管理、屏幕分享、成员管理、麦位控制、基础美颜等丰富功能,同时确保720P和1080P高清画质,在70%丢包率的弱网环境下仍能保持高质量音视频传输。此外,SDK 采用48kHz高音质采样,结合腾讯天籁实验室的3A处理算法,消除回声和啸叫,实现全链路128kbps高音质立体声,为用户带来清晰沉浸的互动体验,本页面包含 atomicx-core sdk 的所有API接口,按功能模块分类展示。
LoginState
🔐 用户身份认证与登录管理模块
核心功能:提供用户登录、登出、个人信息管理等基础身份认证功能,是整个系统的用户身份基础。
技术特点:支持多种登录方式、用户信息缓存、登录状态持久化等功能,确保用户身份的安全性和可靠性。
业务价值:为所有业务模块提供统一的用户身份认证服务,是系统安全和用户体验的基础保障。
应用场景:用户登录、身份验证、个人信息管理、权限控制等核心身份认证场景。
响应式数据
loginUserInfo
Ref<LoginUserInfo | null>
示例
import { useLoginState } from 'tuikit-atomicx-vue3';
const { loginUserInfo } = useLoginState();
// 监听用户信息变化
watch(loginUserInfo, (newUserInfo) => {
if (newUserInfo) {
console.log('用户信息更新:', newUserInfo);
console.log('用户ID:', newUserInfo.userID);
console.log('用户昵称:', newUserInfo.nickname);
console.log('用户头像:', newUserInfo.avatarURL);
}
});
// 获取当前用户信息
const currentUser = loginUserInfo.value;
if (currentUser) {
console.log('当前登录用户:', currentUser.nickname);
}
接口函数
login
示例
import { useLoginState } from 'tuikit-atomicx-vue3';
const { login } = useLoginState();
// 登录系统
await login({
userId: 'user_123456',
userSig: 'xxx',
sdkAppId: 1400000001
});
setSelfInfo
示例
import { useLoginState } from 'tuikit-atomicx-vue3';
const { setSelfInfo } = useLoginState();
// 设置用户个人信息
await setSelfInfo({
nickName: '小明',
avatar: 'https://example.com/avatar.png',
signature: '这是我的个性签名'
});
logout
示例
await logout();
DeviceState
🎥 设备状态管理模块
核心功能:管理摄像头、麦克风等音视频设备的控制,提供设备状态监控、权限检查等基础设备服务。
技术特点:支持多设备管理、设备状态实时监控、权限动态检查、设备故障自动恢复等高级功能。
业务价值:为直播系统提供稳定的设备基础,确保音视频采集的可靠性和用户体验。
应用场景:设备管理、权限控制、音视频采集、设备故障处理等基础技术场景。
响应式数据
microphoneStatus
Ref<DeviceStatus>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { microphoneStatus } = useDeviceState();
// 监听数据变化
watch(microphoneStatus, (newValue) => {
console.log('microphoneStatus 更新:', newValue);
});
// 直接访问数据
console.log('当前 microphoneStatus:', microphoneStatus.value);
microphoneList
Ref<TUIDeviceInfo[]>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { microphoneList } = useDeviceState();
// 监听数据变化
watch(microphoneList, (newValue) => {
console.log('microphoneList 更新:', newValue);
});
// 直接访问数据
console.log('当前 microphoneList:', microphoneList.value);
currentMicrophone
Ref<TUIDeviceInfo | null>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { currentMicrophone } = useDeviceState();
// 监听数据变化
watch(currentMicrophone, (newValue) => {
console.log('currentMicrophone 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentMicrophone:', currentMicrophone.value);
microphoneLastError
Ref<DeviceError>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { microphoneLastError } = useDeviceState();
// 监听数据变化
watch(microphoneLastError, (newValue) => {
console.log('microphoneLastError 更新:', newValue);
});
// 直接访问数据
console.log('当前 microphoneLastError:', microphoneLastError.value);
captureVolume
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { captureVolume } = useDeviceState();
// 监听数据变化
watch(captureVolume, (newValue) => {
console.log('captureVolume 更新:', newValue);
});
// 直接访问数据
console.log('当前 captureVolume:', captureVolume.value);
currentMicVolume
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { currentMicVolume } = useDeviceState();
// 监听数据变化
watch(currentMicVolume, (newValue) => {
console.log('currentMicVolume 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentMicVolume:', currentMicVolume.value);
isMicrophoneTesting
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { isMicrophoneTesting } = useDeviceState();
// 监听数据变化
watch(isMicrophoneTesting, (newValue) => {
console.log('isMicrophoneTesting 更新:', newValue);
});
// 直接访问数据
console.log('当前 isMicrophoneTesting:', isMicrophoneTesting.value);
testingMicVolume
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { testingMicVolume } = useDeviceState();
// 监听数据变化
watch(testingMicVolume, (newValue) => {
console.log('testingMicVolume 更新:', newValue);
});
// 直接访问数据
console.log('当前 testingMicVolume:', testingMicVolume.value);
cameraStatus
Ref<DeviceStatus>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { cameraStatus } = useDeviceState();
// 监听数据变化
watch(cameraStatus, (newValue) => {
console.log('cameraStatus 更新:', newValue);
});
// 直接访问数据
console.log('当前 cameraStatus:', cameraStatus.value);
cameraList
Ref<TUIDeviceInfo[]>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { cameraList } = useDeviceState();
// 监听数据变化
watch(cameraList, (newValue) => {
console.log('cameraList 更新:', newValue);
});
// 直接访问数据
console.log('当前 cameraList:', cameraList.value);
currentCamera
Ref<TUIDeviceInfo | null>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { currentCamera } = useDeviceState();
// 监听数据变化
watch(currentCamera, (newValue) => {
console.log('currentCamera 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentCamera:', currentCamera.value);
cameraLastError
Ref<DeviceError>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { cameraLastError } = useDeviceState();
// 监听数据变化
watch(cameraLastError, (newValue) => {
console.log('cameraLastError 更新:', newValue);
});
// 直接访问数据
console.log('当前 cameraLastError:', cameraLastError.value);
isCameraTesting
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { isCameraTesting } = useDeviceState();
// 监听数据变化
watch(isCameraTesting, (newValue) => {
console.log('isCameraTesting 更新:', newValue);
});
// 直接访问数据
console.log('当前 isCameraTesting:', isCameraTesting.value);
isCameraTestLoading
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { isCameraTestLoading } = useDeviceState();
// 监听数据变化
watch(isCameraTestLoading, (newValue) => {
console.log('isCameraTestLoading 更新:', newValue);
});
// 直接访问数据
console.log('当前 isCameraTestLoading:', isCameraTestLoading.value);
isFrontCamera
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { isFrontCamera } = useDeviceState();
// 监听数据变化
watch(isFrontCamera, (newValue) => {
console.log('isFrontCamera 更新:', newValue);
});
// 直接访问数据
console.log('当前 isFrontCamera:', isFrontCamera.value);
localMirrorType
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { localMirrorType } = useDeviceState();
// 监听数据变化
watch(localMirrorType, (newValue) => {
console.log('localMirrorType 更新:', newValue);
});
// 直接访问数据
console.log('当前 localMirrorType:', localMirrorType.value);
localVideoQuality
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { localVideoQuality } = useDeviceState();
// 监听数据变化
watch(localVideoQuality, (newValue) => {
console.log('localVideoQuality 更新:', newValue);
});
// 直接访问数据
console.log('当前 localVideoQuality:', localVideoQuality.value);
speakerList
Ref<TUIDeviceInfo[]>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { speakerList } = useDeviceState();
// 监听数据变化
watch(speakerList, (newValue) => {
console.log('speakerList 更新:', newValue);
});
// 直接访问数据
console.log('当前 speakerList:', speakerList.value);
currentSpeaker
Ref<TUIDeviceInfo | null>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { currentSpeaker } = useDeviceState();
// 监听数据变化
watch(currentSpeaker, (newValue) => {
console.log('currentSpeaker 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentSpeaker:', currentSpeaker.value);
outputVolume
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { outputVolume } = useDeviceState();
// 监听数据变化
watch(outputVolume, (newValue) => {
console.log('outputVolume 更新:', newValue);
});
// 直接访问数据
console.log('当前 outputVolume:', outputVolume.value);
currentAudioRoute
Ref<AudioRoute>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { currentAudioRoute } = useDeviceState();
// 监听数据变化
watch(currentAudioRoute, (newValue) => {
console.log('currentAudioRoute 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentAudioRoute:', currentAudioRoute.value);
isSpeakerTesting
Ref<any>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { isSpeakerTesting } = useDeviceState();
// 监听数据变化
watch(isSpeakerTesting, (newValue) => {
console.log('isSpeakerTesting 更新:', newValue);
});
// 直接访问数据
console.log('当前 isSpeakerTesting:', isSpeakerTesting.value);
screenStatus
Ref<DeviceStatus>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { screenStatus } = useDeviceState();
// 监听数据变化
watch(screenStatus, (newValue) => {
console.log('screenStatus 更新:', newValue);
});
// 直接访问数据
console.log('当前 screenStatus:', screenStatus.value);
networkInfo
Ref<NetworkInfo | null>
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { networkInfo } = useDeviceState();
// 监听数据变化
watch(networkInfo, (newValue) => {
console.log('networkInfo 更新:', newValue);
});
// 直接访问数据
console.log('当前 networkInfo:', networkInfo.value);
接口函数
openLocalMicrophone
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { openLocalMicrophone } = useDeviceState();
// 开启麦克风
try {
await openLocalMicrophone();
console.log('麦克风开启成功');
} catch (error) {
console.error('麦克风开启失败:', error);
}
closeLocalMicrophone
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { closeLocalMicrophone } = useDeviceState();
// 关闭麦克风
await closeLocalMicrophone();
muteLocalAudio
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { muteLocalAudio } = useDeviceState();
// 静音本地音频
await muteLocalAudio();
unmuteLocalAudio
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { unmuteLocalAudio } = useDeviceState();
// 取消静音本地音频
await unmuteLocalAudio();
getMicrophoneList
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { getMicrophoneList, microphoneList } = useDeviceState();
// 获取麦克风列表
try {
await getMicrophoneList();
console.log('麦克风列表:', microphoneList.value);
} catch (error) {
console.error('获取麦克风列表失败:', error);
}
setCurrentMicrophone
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { setCurrentMicrophone } = useDeviceState();
// 切换麦克风设备
await setCurrentMicrophone({
deviceId: 'default'
});
startMicrophoneTest
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { startMicrophoneTest } = useDeviceState();
// 开始麦克风测试,每200ms检测一次音量
await startMicrophoneTest({
interval: 200
});
setCaptureVolume
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| volume | number |
音量大小(0-100) |
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { setCaptureVolume } = useDeviceState();
// 设置采集音量为80%
await setCaptureVolume(80);
setOutputVolume
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| volume | number |
音量大小(0-100) |
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { setOutputVolume } = useDeviceState();
// 设置播放音量为60%
await setOutputVolume(60);
stopMicrophoneTest
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { stopMicrophoneTest } = useDeviceState();
// 停止麦克风测试
await stopMicrophoneTest();
getSpeakerList
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { getSpeakerList, speakerList } = useDeviceState();
// 获取扬声器列表
try {
await getSpeakerList();
console.log('扬声器列表:', speakerList.value);
} catch (error) {
console.error('获取扬声器列表失败:', error);
}
setCurrentSpeaker
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { setCurrentSpeaker } = useDeviceState();
// 切换扬声器设备
await setCurrentSpeaker({
deviceId: 'default'
});
setAudioRoute
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| output | AudioRoute |
音频路由类型 |
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { setAudioRoute } = useDeviceState();
// 设置为扬声器模式
await setAudioRoute(AudioRoute.Speakerphone);
// 设置为听筒模式
await setAudioRoute(AudioRoute.Earpiece);
startSpeakerTest
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { startSpeakerTest } = useDeviceState();
// 播放测试音频进行扬声器测试
await startSpeakerTest({
filePath: '/assets/audio/test.mp3'
});
stopSpeakerTest
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { stopSpeakerTest } = useDeviceState();
// 停止扬声器测试
await stopSpeakerTest();
openLocalCamera
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { openLocalCamera } = useDeviceState();
// 开启摄像头
try {
await openLocalCamera();
console.log('摄像头开启成功');
} catch (error) {
console.error('摄像头开启失败:', error);
}
closeLocalCamera
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { closeLocalCamera } = useDeviceState();
// 关闭摄像头
await closeLocalCamera();
getCameraList
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { getCameraList, cameraList } = useDeviceState();
// 获取摄像头列表
try {
await getCameraList();
console.log('摄像头列表:', cameraList.value);
} catch (error) {
console.error('获取摄像头列表失败:', error);
}
setCurrentCamera
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { setCurrentCamera } = useDeviceState();
// 切换摄像头设备
await setCurrentCamera({
deviceId: 'default'
});
switchCamera
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { switchCamera } = useDeviceState();
// 切换到前置摄像头
await switchCamera({
isFrontCamera: true
});
switchMirror
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { switchMirror } = useDeviceState();
// 设置视频镜像模式
await switchMirror({
mirror: MirrorType.Enable
});
updateVideoQuality
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { updateVideoQuality } = useDeviceState();
// 设置视频质量为高清720P
await updateVideoQuality({
quality: VideoQuality.HD720P
});
startCameraDeviceTest
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { startCameraDeviceTest } = useDeviceState();
// 在指定DOM元素中预览摄像头
await startCameraDeviceTest({
view: 'camera-preview-container'
});
stopCameraDeviceTest
示例
import { useDeviceState } from 'tuikit-atomicx-vue3';
const { stopCameraDeviceTest } = useDeviceState();
// 停止摄像头测试
await stopCameraDeviceTest();
screenCaptureStopped
示例
// 内部使用,当屏幕分享停止时自动调用
screenCaptureStopped();
LiveListState
📺 直播列表管理模块
核心功能:管理直播间的完整生命周期,包括创建、加入、离开、结束等核心业务流程,支持直播列表的分页获取和实时更新。
技术特点:支持分页加载、实时状态同步、直播信息动态更新,采用响应式数据管理,确保UI与数据状态实时同步。新增liveList和liveListCursor响应式数据,提供fetchLiveList接口函数。
业务价值:为直播平台提供核心的直播间管理能力,支持大规模并发直播场景,是直播业务的基础设施。
应用场景:直播列表展示、直播间创建、直播状态管理、直播数据统计等核心业务场景。
响应式数据
currentLive
Ref<LiveInfo | null>
示例
const tuiLiveInfo = await roomEngine.getLiveInfo();
const liveInfo = getLiveInfo(tuiLiveInfo);
console.log('转换后的直播信息:', liveInfo);
liveList
Ref<any>
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { liveList } = useLiveListState();
// 监听数据变化
watch(liveList, (newValue) => {
console.log('liveList 更新:', newValue);
});
// 直接访问数据
console.log('当前 liveList:', liveList.value);
liveListCursor
Ref<any>
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { liveListCursor } = useLiveListState();
// 监听数据变化
watch(liveListCursor, (newValue) => {
console.log('liveListCursor 更新:', newValue);
});
// 直接访问数据
console.log('当前 liveListCursor:', liveListCursor.value);
接口函数
createLive
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { createLive } = useLiveListState();
// Create a live room with custom settings
await createLive({
name: 'My Live Room',
coverUrl: 'https://example.com/cover.jpg',
backgroundUrl: 'https://example.com/bg.jpg',
seatMode: 'free'
});
joinLive
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { joinLive } = useLiveListState();
// Join a live room by ID
await joinLive({
liveId: 'live_room_123456'
});
leaveLive
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { leaveLive } = useLiveListState();
// 离开直播间
try {
await leaveLive();
console.log('成功离开直播间');
} catch (error) {
console.error('离开直播间失败:', error);
}
endLive
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { endLive } = useLiveListState();
// 结束直播(主播操作)
try {
await endLive();
console.log('直播已结束');
} catch (error) {
console.error('结束直播失败:', error);
}
updateLiveInfo
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { updateLiveInfo } = useLiveListState();
// Update live room info
await updateLiveInfo({
coverUrl: 'https://example.com/new-cover.jpg',
category: 'entertainment'
});
queryMetaData
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { queryMetaData } = useLiveListState();
// Query metadata by keys
await queryMetaData({
keys: ['roomTitle', 'announcement', 'customData']
});
updateLiveMetaData
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { updateLiveMetaData } = useLiveListState();
// Update live room metadata
await updateLiveMetaData({
metaData: {
roomTitle: 'New Room Title',
announcement: 'Welcome to my live room!'
}
});
fetchLiveList
示例
import { useLiveListState } from 'tuikit-atomicx-vue3';
const { fetchLiveList } = useLiveListState();
// Fetch live list with pagination
await fetchLiveList({
cursor: '',
count: 20
});
LiveSeatState
🪑 直播间座位管理模块
核心功能:实现多人连麦场景下的座位控制,支持复杂的座位状态管理和音视频设备控制,包括上麦、下麦、座位锁定等完整功能。
技术特点:基于WebRTC技术,支持多路音视频流管理,提供座位锁定、设备控制、权限管理等高级功能。新增seatList、canvas、speakingUsers、networkQualities响应式数据,以及完整的座位操作接口。
业务价值:为多人互动直播提供核心技术支撑,支持PK、连麦、多人游戏等丰富的互动场景。
应用场景:多人连麦、主播PK、互动游戏、在线教育、会议直播等需要多人音视频互动的场景。
响应式数据
seatList
Ref<any>
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { seatList } = useLiveSeatState();
// 监听数据变化
watch(seatList, (newValue) => {
console.log('seatList 更新:', newValue);
});
// 直接访问数据
console.log('当前 seatList:', seatList.value);
canvas
Ref<any>
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { canvas } = useLiveSeatState();
// 监听数据变化
watch(canvas, (newValue) => {
console.log('canvas 更新:', newValue);
});
// 直接访问数据
console.log('当前 canvas:', canvas.value);
speakingUsers
Ref<any>
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { speakingUsers } = useLiveSeatState();
// 监听数据变化
watch(speakingUsers, (newValue) => {
console.log('speakingUsers 更新:', newValue);
});
// 直接访问数据
console.log('当前 speakingUsers:', speakingUsers.value);
networkQualities
Ref<any>
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { networkQualities } = useLiveSeatState();
// 监听数据变化
watch(networkQualities, (newValue) => {
console.log('networkQualities 更新:', newValue);
});
// 直接访问数据
console.log('当前 networkQualities:', networkQualities.value);
接口函数
takeSeat
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { takeSeat } = useLiveSeatState();
// Take seat at index 1
await takeSeat({
seatIndex: 1
});
leaveSeat
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { leaveSeat } = useLiveSeatState();
// Leave seat at index 1
await leaveSeat({
seatIndex: 1
});
lockSeat
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { lockSeat } = useLiveSeatState();
// Lock seat at index 2
await lockSeat({
seatIndex: 2
});
unLockSeat
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { unLockSeat } = useLiveSeatState();
// Unlock seat at index 2
await unLockSeat({
seatIndex: 2
});
kickUserOutOfSeat
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { kickUserOutOfSeat } = useLiveSeatState();
// Kick user out of seat
await kickUserOutOfSeat({
seatIndex: 1,
userId: 'user_123'
});
moveUserToSeat
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { moveUserToSeat } = useLiveSeatState();
// Move user to target seat
await moveUserToSeat({
userId: 'user_123',
targetSeatIndex: 3
});
openRemoteCamera
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { openRemoteCamera } = useLiveSeatState();
// Open remote user's camera
await openRemoteCamera({
userId: 'user_123'
});
closeRemoteCamera
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { closeRemoteCamera } = useLiveSeatState();
// Close remote user's camera
await closeRemoteCamera({
userId: 'user_123'
});
openRemoteMicrophone
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { openRemoteMicrophone } = useLiveSeatState();
// Open remote user's microphone
await openRemoteMicrophone({
userId: 'user_123'
});
closeRemoteMicrophone
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { closeRemoteMicrophone } = useLiveSeatState();
// Close remote user's microphone
await closeRemoteMicrophone({
userId: 'user_123'
});
muteMicrophone
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { muteMicrophone } = useLiveSeatState();
// Mute user's microphone
await muteMicrophone({
userId: 'user_123'
});
unmuteMicrophone
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { unmuteMicrophone } = useLiveSeatState();
// Unmute user's microphone
await unmuteMicrophone({
userId: 'user_123'
});
startPlayStream
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { startPlayStream } = useLiveSeatState();
// Start playing user's stream
await startPlayStream({
userId: 'user_123',
streamType: 0
});
stopPlayStream
示例
import { useLiveSeatState } from 'tuikit-atomicx-vue3';
const { stopPlayStream } = useLiveSeatState();
// Stop playing user's stream
await stopPlayStream({
userId: 'user_123',
streamType: 0
});
LiveAudienceState
👥 直播间观众管理模块
核心功能:管理直播间观众列表,提供观众权限控制、管理员设置等直播间秩序维护功能,支持实时观众统计。
技术特点:支持实时观众列表更新、权限分级管理、批量操作等高级功能,确保直播间秩序和用户体验。新增audienceList和audienceCount响应式数据。
业务价值:为直播平台提供完整的观众管理解决方案,支持大规模观众场景下的秩序维护。
应用场景:观众管理、权限控制、直播间秩序维护、观众互动管理等核心业务场景。
响应式数据
audienceList
Ref<any>
示例
import { useLiveAudienceState } from 'tuikit-atomicx-vue3';
const { audienceList } = useLiveAudienceState();
// 监听数据变化
watch(audienceList, (newValue) => {
console.log('audienceList 更新:', newValue);
});
// 直接访问数据
console.log('当前 audienceList:', audienceList.value);
audienceCount
Ref<any>
示例
import { useLiveAudienceState } from 'tuikit-atomicx-vue3';
const { audienceCount } = useLiveAudienceState();
// 监听数据变化
watch(audienceCount, (newValue) => {
console.log('audienceCount 更新:', newValue);
});
// 直接访问数据
console.log('当前 audienceCount:', audienceCount.value);
接口函数
fetchAudienceList
示例
import { useLiveAudienceState } from 'tuikit-atomicx-vue3';
const { fetchAudienceList } = useLiveAudienceState();
// Fetch audience list with pagination
await fetchAudienceList({
cursor: '',
count: 50
});
setAdministrator
示例
import { useLiveAudienceState } from 'tuikit-atomicx-vue3';
const { setAdministrator } = useLiveAudienceState();
// Set user as administrator
await setAdministrator({
userId: 'user_123'
});
revokeAdministrator
示例
import { useLiveAudienceState } from 'tuikit-atomicx-vue3';
const { revokeAdministrator } = useLiveAudienceState();
// Revoke administrator privileges
await revokeAdministrator({
userId: 'user_123'
});
kickUserOutOfRoom
示例
import { useLiveAudienceState } from 'tuikit-atomicx-vue3';
const { kickUserOutOfRoom } = useLiveAudienceState();
// Kick user out of room
await kickUserOutOfRoom({
userId: 'user_123'
});
disableSendMessage
示例
import { useLiveAudienceState } from 'tuikit-atomicx-vue3';
const { disableSendMessage } = useLiveAudienceState();
// Disable user from sending messages for 10 minutes
await disableSendMessage({
userId: 'user_123',
duration: 600
});
LiveMonitorState
📊 直播监控管理模块
核心功能:提供直播间实时监控功能,包括直播状态监控、数据统计、异常检测等核心监控能力,支持多直播间监控。
技术特点:支持实时数据采集、多维度监控指标、智能告警机制,确保直播服务的稳定性和可靠性。新增monitorLiveInfoList响应式数据,优化监控接口。
业务价值:为直播平台提供全方位的监控保障,及时发现和处理异常情况,提升服务质量。
应用场景:直播质量监控、性能分析、异常告警、数据统计等运营管理场景。
响应式数据
monitorLiveInfoList
Ref<any>
示例
import { useLiveMonitorState } from 'tuikit-atomicx-vue3';
const { monitorLiveInfoList } = useLiveMonitorState();
// 监听数据变化
watch(monitorLiveInfoList, (newValue) => {
console.log('monitorLiveInfoList 更新:', newValue);
});
// 直接访问数据
console.log('当前 monitorLiveInfoList:', monitorLiveInfoList.value);
接口函数
init
示例
import { useLiveMonitorState } from 'tuikit-atomicx-vue3';
const { init } = useLiveMonitorState();
// Initialize live monitor service
await init({
sdkAppId: 1400000001,
userId: 'admin_user',
userSig: 'eJyrVgrxCdYrSy1SslIy0jNQ0gHzM1NS...'
});
getLiveList
示例
import { useLiveMonitorState } from 'tuikit-atomicx-vue3';
const { getLiveList } = useLiveMonitorState();
// Get live list with pagination
await getLiveList({
cursor: '',
count: 20
});
closeRoom
示例
import { useLiveMonitorState } from 'tuikit-atomicx-vue3';
const { closeRoom } = useLiveMonitorState();
// Close a live room
await closeRoom({
roomId: 'room_123456'
});
sendMessage
示例
import { useLiveMonitorState } from 'tuikit-atomicx-vue3';
const { sendMessage } = useLiveMonitorState();
// Send a text message
await sendMessage({
content: 'Hello everyone!',
type: 'text'
});
startPlay
示例
import { useLiveMonitorState } from 'tuikit-atomicx-vue3';
const { startPlay } = useLiveMonitorState();
// Start playing a live stream
await startPlay({
roomId: 'room_123456',
userId: 'host_user'
});
stopPlay
示例
import { useLiveMonitorState } from 'tuikit-atomicx-vue3';
const { stopPlay } = useLiveMonitorState();
// Stop playing a live stream
await stopPlay({
roomId: 'room_123456',
userId: 'host_user'
});
muteLiveAudio
示例
import { useLiveMonitorState } from 'tuikit-atomicx-vue3';
const { muteLiveAudio } = useLiveMonitorState();
// Mute live audio
await muteLiveAudio({
roomId: 'room_123456',
userId: 'host_user',
isMuted: true
});
CoGuestState
🎤 连麦嘉宾管理模块
核心功能:处理观众与主播之间的连麦互动,管理连麦申请、邀请、接受、拒绝等完整的连麦流程,支持连麦状态管理。
技术特点:基于实时音视频技术,支持连麦状态实时同步、音视频质量自适应、网络状况监控等高级功能。新增connected、invitees、applicants、candidates响应式数据和applyForSeat接口。
业务价值:为直播平台提供观众参与互动的核心能力,增强用户粘性和直播趣味性。
应用场景:观众连麦、互动问答、在线K歌、游戏直播等需要观众参与的互动场景。
响应式数据
candidates
Ref<any>
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { candidates } = useCoGuestState();
// 监听数据变化
watch(candidates, (newValue) => {
console.log('candidates 更新:', newValue);
});
// 直接访问数据
console.log('当前 candidates:', candidates.value);
connected
Ref<any>
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { connected } = useCoGuestState();
// 监听数据变化
watch(connected, (newValue) => {
console.log('connected 更新:', newValue);
});
// 直接访问数据
console.log('当前 connected:', connected.value);
invitees
Ref<any>
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { invitees } = useCoGuestState();
// 监听数据变化
watch(invitees, (newValue) => {
console.log('invitees 更新:', newValue);
});
// 直接访问数据
console.log('当前 invitees:', invitees.value);
applicants
Ref<any>
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { applicants } = useCoGuestState();
// 监听数据变化
watch(applicants, (newValue) => {
console.log('applicants 更新:', newValue);
});
// 直接访问数据
console.log('当前 applicants:', applicants.value);
接口函数
cancelApplication
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { cancelApplication } = useCoGuestState();
// Cancel co-guest application
await cancelApplication({
requestId: 'req_123456'
});
acceptApplication
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { acceptApplication } = useCoGuestState();
// Accept co-guest application
await acceptApplication({
requestId: 'req_123456'
});
rejectApplication
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { rejectApplication } = useCoGuestState();
// Reject co-guest application
await rejectApplication({
requestId: 'req_123456'
});
cancelInvitation
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { cancelInvitation } = useCoGuestState();
// Cancel co-guest invitation
await cancelInvitation({
requestId: 'req_123456'
});
acceptInvitation
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { acceptInvitation } = useCoGuestState();
// Accept co-guest invitation
await acceptInvitation({
requestId: 'req_123456'
});
rejectInvitation
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { rejectInvitation } = useCoGuestState();
// Reject co-guest invitation
await rejectInvitation({
requestId: 'req_123456'
});
disConnect
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { disConnect } = useCoGuestState();
// Disconnect co-guest connection
await disConnect({
userId: 'user_123'
});
applyForSeat
示例
import { useCoGuestState } from 'tuikit-atomicx-vue3';
const { applyForSeat } = useCoGuestState();
// Apply for a seat with 60 seconds timeout
await applyForSeat({
seatIndex: 1,
timeout: 60
});
CoHostState
🤝 连麦主播管理模块
核心功能:实现主播间的连麦功能,支持主播邀请、连麦申请、连麦状态管理等主播间互动功能,提供完整的主播连麦流程。
技术特点:支持多主播音视频同步、画中画显示、音视频质量优化等高级技术,确保连麦体验的流畅性。新增coHostStatus、connected、applicant、invitees、candidates响应式数据和完整的连麦控制接口。
业务价值:为直播平台提供主播间协作的核心能力,支持PK、合作直播等高级业务场景。
应用场景:主播PK、合作直播、跨平台连麦、主播互动等高级直播场景。
响应式数据
coHostStatus
Ref<any>
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { coHostStatus } = useCoHostState();
// 监听数据变化
watch(coHostStatus, (newValue) => {
console.log('coHostStatus 更新:', newValue);
});
// 直接访问数据
console.log('当前 coHostStatus:', coHostStatus.value);
connected
Ref<any>
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { connected } = useCoHostState();
// 监听数据变化
watch(connected, (newValue) => {
console.log('connected 更新:', newValue);
});
// 直接访问数据
console.log('当前 connected:', connected.value);
applicant
Ref<any>
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { applicant } = useCoHostState();
// 监听数据变化
watch(applicant, (newValue) => {
console.log('applicant 更新:', newValue);
});
// 直接访问数据
console.log('当前 applicant:', applicant.value);
invitees
Ref<any>
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { invitees } = useCoHostState();
// 监听数据变化
watch(invitees, (newValue) => {
console.log('invitees 更新:', newValue);
});
// 直接访问数据
console.log('当前 invitees:', invitees.value);
candidates
Ref<any>
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { candidates } = useCoHostState();
// 监听数据变化
watch(candidates, (newValue) => {
console.log('candidates 更新:', newValue);
});
// 直接访问数据
console.log('当前 candidates:', candidates.value);
接口函数
requestHostConnection
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { requestHostConnection } = useCoHostState();
// Request host connection with 60 seconds timeout
await requestHostConnection({
targetUserId: 'host_123',
timeout: 60
});
cancelHostConnection
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { cancelHostConnection } = useCoHostState();
// Cancel host connection request
await cancelHostConnection({
targetUserId: 'host_123'
});
acceptHostConnection
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { acceptHostConnection } = useCoHostState();
// Accept host connection request
await acceptHostConnection({
targetUserId: 'host_123'
});
rejectHostConnection
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { rejectHostConnection } = useCoHostState();
// Reject host connection request
await rejectHostConnection({
targetUserId: 'host_123'
});
exitHostConnection
示例
import { useCoHostState } from 'tuikit-atomicx-vue3';
const { exitHostConnection } = useCoHostState();
// Exit host connection
await exitHostConnection({
targetUserId: 'host_123'
});
BattleState
⚔️ PK对战管理模块
核心功能:管理主播间的PK对战功能,包括对战邀请、接受、拒绝、结束等完整的PK流程,支持实时比分统计。
技术特点:支持实时对战状态同步、比分计算、对战结果统计等功能。新增battleScore响应式数据,提供完整的PK对战体验。
业务价值:为直播平台提供竞技互动功能,增强直播趣味性和用户参与度。
应用场景:主播PK、才艺比拼、游戏对战、互动竞技等娱乐场景。
响应式数据
currentBattleInfo
Ref<BattleInfo>
示例
import { useBattleState } from 'tuikit-atomicx-vue3';
const { currentBattleInfo } = useBattleState();
// 监听数据变化
watch(currentBattleInfo, (newValue) => {
console.log('currentBattleInfo 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentBattleInfo:', currentBattleInfo.value);
battleUsers
Ref<SeatUserInfo[]>
示例
import { useBattleState } from 'tuikit-atomicx-vue3';
const { battleUsers } = useBattleState();
// 监听数据变化
watch(battleUsers, (newValue) => {
console.log('battleUsers 更新:', newValue);
});
// 直接访问数据
console.log('当前 battleUsers:', battleUsers.value);
battleScore
Ref<any>
示例
import { useBattleState } from 'tuikit-atomicx-vue3';
const { battleScore } = useBattleState();
// 监听数据变化
watch(battleScore, (newValue) => {
console.log('battleScore 更新:', newValue);
});
// 直接访问数据
console.log('当前 battleScore:', battleScore.value);
接口函数
requestBattle
示例
import { useBattleState } from 'tuikit-atomicx-vue3';
const { requestBattle } = useBattleState();
// Request battle with 5 minutes duration
await requestBattle({
targetUserId: 'host_123',
duration: 300
});
cancelBattleRequest
示例
import { useBattleState } from 'tuikit-atomicx-vue3';
const { cancelBattleRequest } = useBattleState();
// Cancel battle request
await cancelBattleRequest({
targetUserId: 'host_123'
});
acceptBattle
示例
import { useBattleState } from 'tuikit-atomicx-vue3';
const { acceptBattle } = useBattleState();
// Accept battle request
await acceptBattle({
targetUserId: 'host_123'
});
rejectBattle
示例
import { useBattleState } from 'tuikit-atomicx-vue3';
const { rejectBattle } = useBattleState();
// Reject battle request
await rejectBattle({
targetUserId: 'host_123'
});
exitBattle
示例
import { useBattleState } from 'tuikit-atomicx-vue3';
const { exitBattle } = useBattleState();
// Exit battle
await exitBattle({
targetUserId: 'host_123'
});
BarrageState
💬 弹幕消息管理模块
核心功能:处理直播间内的文本消息、自定义消息等弹幕功能,支持弹幕发送、消息状态同步等完整弹幕系统,提供本地提示功能。
技术特点:支持高并发消息处理、实时消息同步、消息过滤、表情包支持等高级功能。新增sendTextMessage、sendCustomMessage、appendLocalTip接口函数。
业务价值:为直播平台提供核心的互动能力,增强用户参与度和直播氛围。
应用场景:弹幕互动、消息管理、表情包、聊天室等社交互动场景。
响应式数据
messageList
Ref<Barrage[]>
示例
import { useBarrageState } from 'tuikit-atomicx-vue3';
const { messageList } = useBarrageState();
// 监听数据变化
watch(messageList, (newValue) => {
console.log('messageList 更新:', newValue);
});
// 直接访问数据
console.log('当前 messageList:', messageList.value);
接口函数
sendTextMessage
示例
import { useBarrageState } from 'tuikit-atomicx-vue3';
const { sendTextMessage } = useBarrageState();
// Send text barrage message
await sendTextMessage({
text: 'Great live stream!',
receiverList: []
});
sendCustomMessage
示例
import { useBarrageState } from 'tuikit-atomicx-vue3';
const { sendCustomMessage } = useBarrageState();
// Send custom barrage message (e.g., gift)
await sendCustomMessage({
data: JSON.stringify({ type: 'gift', giftId: 'rocket', count: 1 }),
receiverList: []
});
appendLocalTip
示例
import { useBarrageState } from 'tuikit-atomicx-vue3';
const { appendLocalTip } = useBarrageState();
// Append local tip message
await appendLocalTip({
message: 'Welcome to the live room!',
type: 'info'
});
MessageListState
📝 消息列表管理模块
核心功能:管理聊天消息列表,支持消息加载、滚动控制、已读回执、消息高亮等完整的消息展示功能。
技术特点:支持虚拟滚动、消息优化、实时更新等高性能消息处理。新增activeConversationID、messageList、hasMoreOlderMessage等响应式数据。
业务价值:为即时通信提供核心的消息展示能力,确保良好的聊天体验。
应用场景:即时通信、群聊、私聊、消息管理等通信场景。
响应式数据
activeConversationID
Ref<any>
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { activeConversationID } = useMessageListState();
// 监听数据变化
watch(activeConversationID, (newValue) => {
console.log('activeConversationID 更新:', newValue);
});
// 直接访问数据
console.log('当前 activeConversationID:', activeConversationID.value);
messageList
Ref<any>
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { messageList } = useMessageListState();
// 监听数据变化
watch(messageList, (newValue) => {
console.log('messageList 更新:', newValue);
});
// 直接访问数据
console.log('当前 messageList:', messageList.value);
hasMoreOlderMessage
Ref<any>
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { hasMoreOlderMessage } = useMessageListState();
// 监听数据变化
watch(hasMoreOlderMessage, (newValue) => {
console.log('hasMoreOlderMessage 更新:', newValue);
});
// 直接访问数据
console.log('当前 hasMoreOlderMessage:', hasMoreOlderMessage.value);
hasMoreNewerMessage
Ref<any>
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { hasMoreNewerMessage } = useMessageListState();
// 监听数据变化
watch(hasMoreNewerMessage, (newValue) => {
console.log('hasMoreNewerMessage 更新:', newValue);
});
// 直接访问数据
console.log('当前 hasMoreNewerMessage:', hasMoreNewerMessage.value);
enableReadReceipt
Ref<any>
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { enableReadReceipt } = useMessageListState();
// 监听数据变化
watch(enableReadReceipt, (newValue) => {
console.log('enableReadReceipt 更新:', newValue);
});
// 直接访问数据
console.log('当前 enableReadReceipt:', enableReadReceipt.value);
isDisableScroll
Ref<any>
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { isDisableScroll } = useMessageListState();
// 监听数据变化
watch(isDisableScroll, (newValue) => {
console.log('isDisableScroll 更新:', newValue);
});
// 直接访问数据
console.log('当前 isDisableScroll:', isDisableScroll.value);
recalledMessageIDSet
Ref<any>
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { recalledMessageIDSet } = useMessageListState();
// 监听数据变化
watch(recalledMessageIDSet, (newValue) => {
console.log('recalledMessageIDSet 更新:', newValue);
});
// 直接访问数据
console.log('当前 recalledMessageIDSet:', recalledMessageIDSet.value);
highlightMessageIDSet
Ref<any>
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { highlightMessageIDSet } = useMessageListState();
// 监听数据变化
watch(highlightMessageIDSet, (newValue) => {
console.log('highlightMessageIDSet 更新:', newValue);
});
// 直接访问数据
console.log('当前 highlightMessageIDSet:', highlightMessageIDSet.value);
接口函数
setEnableReadReceipt
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { setEnableReadReceipt } = useMessageListState();
// Enable read receipt
await setEnableReadReceipt({
enabled: true
});
setIsDisableScroll
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { setIsDisableScroll } = useMessageListState();
// Disable auto scroll
await setIsDisableScroll({
disabled: true
});
highlightMessage
示例
import { useMessageListState } from 'tuikit-atomicx-vue3';
const { highlightMessage } = useMessageListState();
// Highlight a specific message for 3 seconds
await highlightMessage({
messageId: 'msg_123456',
duration: 3000
});
MessageInputState
✏️ 消息输入管理模块
核心功能:管理消息输入框的状态和行为,支持文本输入、表情包、@功能、输入状态提示等完整的输入体验。
技术特点:支持富文本编辑、输入状态同步、草稿保存等功能。新增inputRawValue、isPeerTyping响应式数据。
业务价值:为用户提供便捷的消息输入体验,提升沟通效率。
应用场景:消息编辑、表情输入、文件发送、语音输入等输入场景。
响应式数据
inputRawValue
Ref<any>
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { inputRawValue } = useMessageInputState();
// 监听数据变化
watch(inputRawValue, (newValue) => {
console.log('inputRawValue 更新:', newValue);
});
// 直接访问数据
console.log('当前 inputRawValue:', inputRawValue.value);
isPeerTyping
Ref<any>
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { isPeerTyping } = useMessageInputState();
// 监听数据变化
watch(isPeerTyping, (newValue) => {
console.log('isPeerTyping 更新:', newValue);
});
// 直接访问数据
console.log('当前 isPeerTyping:', isPeerTyping.value);
接口函数
updateRawValue
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { updateRawValue } = useMessageInputState();
// Update input raw value
await updateRawValue({
value: 'Hello, world!'
});
setEditorInstance
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { setEditorInstance } = useMessageInputState();
// Set editor instance
await setEditorInstance({
editor: editorRef
});
setContent
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { setContent } = useMessageInputState();
// Set editor content
await setContent({
content: 'New message content'
});
insertContent
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { insertContent } = useMessageInputState();
// Insert content at cursor position
await insertContent({
content: '@user ',
position: 0
});
focusEditor
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { focusEditor } = useMessageInputState();
// 聚焦编辑器
focusEditor();
blurEditor
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { blurEditor } = useMessageInputState();
// 失焦编辑器
blurEditor();
sendMessage
示例
import { useMessageInputState } from 'tuikit-atomicx-vue3';
const { sendMessage } = useMessageInputState();
// Send a text message
await sendMessage({
content: 'Hello everyone!',
type: 'text'
});
MessageActionState
🔧 消息操作管理模块
核心功能:管理消息的各种操作,包括转发、引用、复制、删除、撤回等完整的消息操作功能。
技术特点:支持批量操作、操作状态管理、权限控制等功能。新增forwardMessageIDList、isForwardMessageSelectionDone等响应式数据。
业务价值:为用户提供丰富的消息操作能力,提升使用体验。
应用场景:消息转发、消息引用、消息管理、批量操作等场景。
响应式数据
forwardMessageIDList
Ref<any>
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { forwardMessageIDList } = useMessageActionState();
// 监听数据变化
watch(forwardMessageIDList, (newValue) => {
console.log('forwardMessageIDList 更新:', newValue);
});
// 直接访问数据
console.log('当前 forwardMessageIDList:', forwardMessageIDList.value);
isForwardMessageSelectionDone
Ref<any>
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { isForwardMessageSelectionDone } = useMessageActionState();
// 监听数据变化
watch(isForwardMessageSelectionDone, (newValue) => {
console.log('isForwardMessageSelectionDone 更新:', newValue);
});
// 直接访问数据
console.log('当前 isForwardMessageSelectionDone:', isForwardMessageSelectionDone.value);
forwardConversationIDList
Ref<any>
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { forwardConversationIDList } = useMessageActionState();
// 监听数据变化
watch(forwardConversationIDList, (newValue) => {
console.log('forwardConversationIDList 更新:', newValue);
});
// 直接访问数据
console.log('当前 forwardConversationIDList:', forwardConversationIDList.value);
quotedMessage
Ref<any>
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { quotedMessage } = useMessageActionState();
// 监听数据变化
watch(quotedMessage, (newValue) => {
console.log('quotedMessage 更新:', newValue);
});
// 直接访问数据
console.log('当前 quotedMessage:', quotedMessage.value);
接口函数
forwardMessage
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { forwardMessage } = useMessageActionState();
// Forward messages to conversations
await forwardMessage({
messageIds: ['msg_001', 'msg_002'],
conversationIds: ['C2C_user123', 'GROUP_group456']
});
setForwardMessageIDList
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { setForwardMessageIDList } = useMessageActionState();
// Set forward message ID list
await setForwardMessageIDList({
messageIds: ['msg_001', 'msg_002', 'msg_003']
});
setIsForwardMessageSelectionDone
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { setIsForwardMessageSelectionDone } = useMessageActionState();
// Mark forward message selection as done
await setIsForwardMessageSelectionDone({
done: true
});
setForwardConversationIDList
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { setForwardConversationIDList } = useMessageActionState();
// Set forward conversation ID list
await setForwardConversationIDList({
conversationIds: ['C2C_user123', 'GROUP_group456']
});
quoteMessage
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { quoteMessage } = useMessageActionState();
// Quote a message for reply
await quoteMessage({
messageId: 'msg_123456'
});
clearQuotedMessage
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { clearQuotedMessage } = useMessageActionState();
// 清除引用消息
clearQuotedMessage();
copyTextMessage
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { copyTextMessage } = useMessageActionState();
// Copy text message content
await copyTextMessage({
messageId: 'msg_123456'
});
deleteMessage
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { deleteMessage } = useMessageActionState();
// Delete a message
await deleteMessage({
messageId: 'msg_123456'
});
recallMessage
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { recallMessage } = useMessageActionState();
// Recall a message
await recallMessage({
messageId: 'msg_123456'
});
resetMessageActionState
示例
import { useMessageActionState } from 'tuikit-atomicx-vue3';
const { resetMessageActionState } = useMessageActionState();
// 重置所有消息操作状态
resetMessageActionState();
ConversationListState
💼 会话列表管理模块
核心功能:管理用户的会话列表,支持会话排序、未读统计、会话操作等完整的会话管理功能。
技术特点:支持实时会话更新、智能排序、网络状态监控等功能。新增conversationList、activeConversation、totalUnRead、netStatus响应式数据。
业务价值:为用户提供清晰的会话管理界面,提升沟通效率。
应用场景:会话管理、联系人列表、群组管理、消息中心等场景。
响应式数据
conversationList
Ref<any>
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { conversationList } = useConversationListState();
// 监听数据变化
watch(conversationList, (newValue) => {
console.log('conversationList 更新:', newValue);
});
// 直接访问数据
console.log('当前 conversationList:', conversationList.value);
activeConversation
Ref<any>
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { activeConversation } = useConversationListState();
// 监听数据变化
watch(activeConversation, (newValue) => {
console.log('activeConversation 更新:', newValue);
});
// 直接访问数据
console.log('当前 activeConversation:', activeConversation.value);
totalUnRead
Ref<any>
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { totalUnRead } = useConversationListState();
// 监听数据变化
watch(totalUnRead, (newValue) => {
console.log('totalUnRead 更新:', newValue);
});
// 直接访问数据
console.log('当前 totalUnRead:', totalUnRead.value);
netStatus
Ref<any>
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { netStatus } = useConversationListState();
// 监听数据变化
watch(netStatus, (newValue) => {
console.log('netStatus 更新:', newValue);
});
// 直接访问数据
console.log('当前 netStatus:', netStatus.value);
接口函数
markConversationUnread
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { markConversationUnread } = useConversationListState();
// Mark conversation as unread
await markConversationUnread({
conversationId: 'C2C_user123',
unreadCount: 1
});
setActiveConversation
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { setActiveConversation } = useConversationListState();
// Set active conversation
await setActiveConversation({
conversationId: 'C2C_user123'
});
pinConversation
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { pinConversation } = useConversationListState();
// Pin conversation to top
await pinConversation({
conversationId: 'C2C_user123',
isPinned: true
});
deleteConversation
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { deleteConversation } = useConversationListState();
// Delete a conversation
await deleteConversation({
conversationId: 'C2C_user123'
});
muteConversation
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { muteConversation } = useConversationListState();
// Mute conversation notifications
await muteConversation({
conversationId: 'C2C_user123',
isMuted: true
});
setConversationDraft
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { setConversationDraft } = useConversationListState();
// Set conversation draft
await setConversationDraft({
conversationId: 'C2C_user123',
draft: 'Draft message content...'
});
createC2CConversation
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { createC2CConversation } = useConversationListState();
// Create C2C (one-to-one) conversation
await createC2CConversation({
userId: 'user_123'
});
createGroupConversation
示例
import { useConversationListState } from 'tuikit-atomicx-vue3';
const { createGroupConversation } = useConversationListState();
// Create group conversation
await createGroupConversation({
groupId: 'group_456'
});
ContactListState
👥 联系人管理模块
核心功能:管理用户的联系人列表,包括好友管理、群组管理、黑名单管理等完整的联系人功能。
技术特点:支持联系人分组、好友申请处理、群组申请管理等功能。新增friendList、groupList、blackList等响应式数据和完整的联系人操作接口。
业务价值:为用户提供完整的社交关系管理能力,构建社交网络。
应用场景:好友管理、群组管理、联系人搜索、社交网络等场景。
响应式数据
friendList
Ref<any>
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { friendList } = useContactListState();
// 监听数据变化
watch(friendList, (newValue) => {
console.log('friendList 更新:', newValue);
});
// 直接访问数据
console.log('当前 friendList:', friendList.value);
groupList
Ref<any>
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { groupList } = useContactListState();
// 监听数据变化
watch(groupList, (newValue) => {
console.log('groupList 更新:', newValue);
});
// 直接访问数据
console.log('当前 groupList:', groupList.value);
blackList
Ref<any>
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { blackList } = useContactListState();
// 监听数据变化
watch(blackList, (newValue) => {
console.log('blackList 更新:', newValue);
});
// 直接访问数据
console.log('当前 blackList:', blackList.value);
friendApplicationUnreadCount
Ref<any>
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { friendApplicationUnreadCount } = useContactListState();
// 监听数据变化
watch(friendApplicationUnreadCount, (newValue) => {
console.log('friendApplicationUnreadCount 更新:', newValue);
});
// 直接访问数据
console.log('当前 friendApplicationUnreadCount:', friendApplicationUnreadCount.value);
friendGroupList
Ref<any>
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { friendGroupList } = useContactListState();
// 监听数据变化
watch(friendGroupList, (newValue) => {
console.log('friendGroupList 更新:', newValue);
});
// 直接访问数据
console.log('当前 friendGroupList:', friendGroupList.value);
friendApplicationList
Ref<any>
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { friendApplicationList } = useContactListState();
// 监听数据变化
watch(friendApplicationList, (newValue) => {
console.log('friendApplicationList 更新:', newValue);
});
// 直接访问数据
console.log('当前 friendApplicationList:', friendApplicationList.value);
groupApplicationList
Ref<any>
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { groupApplicationList } = useContactListState();
// 监听数据变化
watch(groupApplicationList, (newValue) => {
console.log('groupApplicationList 更新:', newValue);
});
// 直接访问数据
console.log('当前 groupApplicationList:', groupApplicationList.value);
接口函数
setGroupApplicationList
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { setGroupApplicationList } = useContactListState();
// Set group application list
await setGroupApplicationList({
applicationList: []
});
setFriendList
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { setFriendList } = useContactListState();
// Set friend list
await setFriendList({
friendList: []
});
setGroupList
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { setGroupList } = useContactListState();
// Set group list
await setGroupList({
groupList: []
});
setBlackList
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { setBlackList } = useContactListState();
// Set black list
await setBlackList({
blackList: []
});
setFriendApplicationUnreadCount
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { setFriendApplicationUnreadCount } = useContactListState();
// Set friend application unread count
await setFriendApplicationUnreadCount({
count: 5
});
setFriendGroupList
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { setFriendGroupList } = useContactListState();
// Set friend group list
await setFriendGroupList({
groupList: []
});
setFriendApplicationList
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { setFriendApplicationList } = useContactListState();
// Set friend application list
await setFriendApplicationList({
applicationList: []
});
initContactListWatcher
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { initContactListWatcher } = useContactListState();
// Initialize contact list watcher
await initContactListWatcher({
autoUpdate: true
});
addFriend
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { addFriend } = useContactListState();
// Add friend with remark
await addFriend({
userId: 'user_123',
remark: 'My Friend',
addSource: 'search'
});
markFriendApplicationAsRead
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { markFriendApplicationAsRead } = useContactListState();
// Mark friend applications as read
await markFriendApplicationAsRead({
applicationList: ['app_001', 'app_002']
});
acceptFriendApplication
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { acceptFriendApplication } = useContactListState();
// Accept friend application
await acceptFriendApplication({
userId: 'user_123',
remark: 'New Friend'
});
refuseFriendApplication
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { refuseFriendApplication } = useContactListState();
// Refuse friend application
await refuseFriendApplication({
userId: 'user_123'
});
addToBlacklist
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { addToBlacklist } = useContactListState();
// Add user to blacklist
await addToBlacklist({
userId: 'user_123'
});
removeFromBlacklist
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { removeFromBlacklist } = useContactListState();
// Remove user from blacklist
await removeFromBlacklist({
userId: 'user_123'
});
deleteFriend
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { deleteFriend } = useContactListState();
// Delete friend
await deleteFriend({
userId: 'user_123'
});
setFriendRemark
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { setFriendRemark } = useContactListState();
// Set friend remark
await setFriendRemark({
userId: 'user_123',
remark: 'Best Friend'
});
createFriendGroup
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { createFriendGroup } = useContactListState();
// Create friend group
await createFriendGroup({
groupName: 'Close Friends',
userList: ['user_001', 'user_002']
});
deleteFriendGroup
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { deleteFriendGroup } = useContactListState();
// Delete friend group
await deleteFriendGroup({
groupName: 'Old Group'
});
addToFriendGroup
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { addToFriendGroup } = useContactListState();
// Add friends to group
await addToFriendGroup({
groupName: 'Close Friends',
userList: ['user_003', 'user_004']
});
removeFromFriendGroup
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { removeFromFriendGroup } = useContactListState();
// Remove friends from group
await removeFromFriendGroup({
groupName: 'Close Friends',
userList: ['user_003']
});
renameFriendGroup
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { renameFriendGroup } = useContactListState();
// Rename friend group
await renameFriendGroup({
oldGroupName: 'Close Friends',
newGroupName: 'Best Friends'
});
joinGroup
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { joinGroup } = useContactListState();
// Join a group
await joinGroup({
groupId: 'group_123',
message: 'I want to join this group'
});
acceptGroupApplication
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { acceptGroupApplication } = useContactListState();
// Accept group application
await acceptGroupApplication({
groupId: 'group_123',
userId: 'user_456'
});
refuseGroupApplication
示例
import { useContactListState } from 'tuikit-atomicx-vue3';
const { refuseGroupApplication } = useContactListState();
// Refuse group application
await refuseGroupApplication({
groupId: 'group_123',
userId: 'user_456',
reason: 'Group is full'
});
C2CSettingState
👤 单聊设置管理模块
核心功能:管理单聊会话的各种设置,包括用户信息、聊天设置、权限控制等功能。
技术特点:支持实时设置同步、权限管理、个性化配置等功能。更新响应式数据为userID、avatar、signature等标准化字段。
业务价值:为用户提供个性化的单聊体验,提升沟通质量。
应用场景:单聊设置、用户信息管理、聊天权限控制等场景。
响应式数据
currentConversationRef
Ref<IConversationModel | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { currentConversationRef } = useC2CSettingState();
// 监听数据变化
watch(currentConversationRef, (newValue) => {
console.log('currentConversationRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentConversationRef:', currentConversationRef.value);
userIDRef
Ref<string | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { userIDRef } = useC2CSettingState();
// 监听数据变化
watch(userIDRef, (newValue) => {
console.log('userIDRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 userIDRef:', userIDRef.value);
nickRef
Ref<string | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { nickRef } = useC2CSettingState();
// 监听数据变化
watch(nickRef, (newValue) => {
console.log('nickRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 nickRef:', nickRef.value);
avatarRef
Ref<string | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { avatarRef } = useC2CSettingState();
// 监听数据变化
watch(avatarRef, (newValue) => {
console.log('avatarRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 avatarRef:', avatarRef.value);
signatureRef
Ref<string | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { signatureRef } = useC2CSettingState();
// 监听数据变化
watch(signatureRef, (newValue) => {
console.log('signatureRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 signatureRef:', signatureRef.value);
remarkRef
Ref<string | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { remarkRef } = useC2CSettingState();
// 监听数据变化
watch(remarkRef, (newValue) => {
console.log('remarkRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 remarkRef:', remarkRef.value);
isMutedRef
Ref<boolean | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { isMutedRef } = useC2CSettingState();
// 监听数据变化
watch(isMutedRef, (newValue) => {
console.log('isMutedRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 isMutedRef:', isMutedRef.value);
isPinnedRef
Ref<boolean | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { isPinnedRef } = useC2CSettingState();
// 监听数据变化
watch(isPinnedRef, (newValue) => {
console.log('isPinnedRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 isPinnedRef:', isPinnedRef.value);
isContactRef
Ref<boolean | undefined>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { isContactRef } = useC2CSettingState();
// 监听数据变化
watch(isContactRef, (newValue) => {
console.log('isContactRef 更新:', newValue);
});
// 直接访问数据
console.log('当前 isContactRef:', isContactRef.value);
userID
Ref<any>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { userID } = useC2CSettingState();
// 监听数据变化
watch(userID, (newValue) => {
console.log('userID 更新:', newValue);
});
// 直接访问数据
console.log('当前 userID:', userID.value);
avatar
Ref<any>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { avatar } = useC2CSettingState();
// 监听数据变化
watch(avatar, (newValue) => {
console.log('avatar 更新:', newValue);
});
// 直接访问数据
console.log('当前 avatar:', avatar.value);
signature
Ref<any>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { signature } = useC2CSettingState();
// 监听数据变化
watch(signature, (newValue) => {
console.log('signature 更新:', newValue);
});
// 直接访问数据
console.log('当前 signature:', signature.value);
remark
Ref<any>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { remark } = useC2CSettingState();
// 监听数据变化
watch(remark, (newValue) => {
console.log('remark 更新:', newValue);
});
// 直接访问数据
console.log('当前 remark:', remark.value);
isMuted
Ref<any>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { isMuted } = useC2CSettingState();
// 监听数据变化
watch(isMuted, (newValue) => {
console.log('isMuted 更新:', newValue);
});
// 直接访问数据
console.log('当前 isMuted:', isMuted.value);
isPinned
Ref<any>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { isPinned } = useC2CSettingState();
// 监听数据变化
watch(isPinned, (newValue) => {
console.log('isPinned 更新:', newValue);
});
// 直接访问数据
console.log('当前 isPinned:', isPinned.value);
isContact
Ref<any>
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { isContact } = useC2CSettingState();
// 监听数据变化
watch(isContact, (newValue) => {
console.log('isContact 更新:', newValue);
});
// 直接访问数据
console.log('当前 isContact:', isContact.value);
接口函数
setChatPinned
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { setChatPinned } = useC2CSettingState();
// Pin chat to top
await setChatPinned({
conversationId: 'C2C_user123',
isPinned: true
});
setChatMuted
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { setChatMuted } = useC2CSettingState();
// Mute chat notifications
await setChatMuted({
conversationId: 'C2C_user123',
isMuted: true
});
setUserRemark
示例
import { useC2CSettingState } from 'tuikit-atomicx-vue3';
const { setUserRemark } = useC2CSettingState();
// Set user remark
await setUserRemark({
userId: 'user_123',
remark: 'My Best Friend'
});
GroupSettingState
👥 群聊设置管理模块
核心功能:管理群聊的各种设置和操作,包括群信息管理、成员管理、权限控制等完整的群管理功能。
技术特点:支持群权限管理、成员操作、群设置同步等功能。新增groupID、groupType、groupName等完整的群信息响应式数据和管理接口。
业务价值:为群主和管理员提供完整的群管理能力,维护群秩序。
应用场景:群管理、成员管理、权限控制、群设置等场景。
响应式数据
groupID
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { groupID } = useGroupSettingState();
// 监听数据变化
watch(groupID, (newValue) => {
console.log('groupID 更新:', newValue);
});
// 直接访问数据
console.log('当前 groupID:', groupID.value);
groupType
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { groupType } = useGroupSettingState();
// 监听数据变化
watch(groupType, (newValue) => {
console.log('groupType 更新:', newValue);
});
// 直接访问数据
console.log('当前 groupType:', groupType.value);
groupName
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { groupName } = useGroupSettingState();
// 监听数据变化
watch(groupName, (newValue) => {
console.log('groupName 更新:', newValue);
});
// 直接访问数据
console.log('当前 groupName:', groupName.value);
avatar
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { avatar } = useGroupSettingState();
// 监听数据变化
watch(avatar, (newValue) => {
console.log('avatar 更新:', newValue);
});
// 直接访问数据
console.log('当前 avatar:', avatar.value);
introduction
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { introduction } = useGroupSettingState();
// 监听数据变化
watch(introduction, (newValue) => {
console.log('introduction 更新:', newValue);
});
// 直接访问数据
console.log('当前 introduction:', introduction.value);
notification
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { notification } = useGroupSettingState();
// 监听数据变化
watch(notification, (newValue) => {
console.log('notification 更新:', newValue);
});
// 直接访问数据
console.log('当前 notification:', notification.value);
isMuted
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { isMuted } = useGroupSettingState();
// 监听数据变化
watch(isMuted, (newValue) => {
console.log('isMuted 更新:', newValue);
});
// 直接访问数据
console.log('当前 isMuted:', isMuted.value);
isPinned
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { isPinned } = useGroupSettingState();
// 监听数据变化
watch(isPinned, (newValue) => {
console.log('isPinned 更新:', newValue);
});
// 直接访问数据
console.log('当前 isPinned:', isPinned.value);
groupOwner
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { groupOwner } = useGroupSettingState();
// 监听数据变化
watch(groupOwner, (newValue) => {
console.log('groupOwner 更新:', newValue);
});
// 直接访问数据
console.log('当前 groupOwner:', groupOwner.value);
adminMembers
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { adminMembers } = useGroupSettingState();
// 监听数据变化
watch(adminMembers, (newValue) => {
console.log('adminMembers 更新:', newValue);
});
// 直接访问数据
console.log('当前 adminMembers:', adminMembers.value);
allMembers
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { allMembers } = useGroupSettingState();
// 监听数据变化
watch(allMembers, (newValue) => {
console.log('allMembers 更新:', newValue);
});
// 直接访问数据
console.log('当前 allMembers:', allMembers.value);
memberCount
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { memberCount } = useGroupSettingState();
// 监听数据变化
watch(memberCount, (newValue) => {
console.log('memberCount 更新:', newValue);
});
// 直接访问数据
console.log('当前 memberCount:', memberCount.value);
maxMemberCount
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { maxMemberCount } = useGroupSettingState();
// 监听数据变化
watch(maxMemberCount, (newValue) => {
console.log('maxMemberCount 更新:', newValue);
});
// 直接访问数据
console.log('当前 maxMemberCount:', maxMemberCount.value);
currentUserID
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { currentUserID } = useGroupSettingState();
// 监听数据变化
watch(currentUserID, (newValue) => {
console.log('currentUserID 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentUserID:', currentUserID.value);
currentUserRole
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { currentUserRole } = useGroupSettingState();
// 监听数据变化
watch(currentUserRole, (newValue) => {
console.log('currentUserRole 更新:', newValue);
});
// 直接访问数据
console.log('当前 currentUserRole:', currentUserRole.value);
nameCard
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { nameCard } = useGroupSettingState();
// 监听数据变化
watch(nameCard, (newValue) => {
console.log('nameCard 更新:', newValue);
});
// 直接访问数据
console.log('当前 nameCard:', nameCard.value);
isMuteAllMembers
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { isMuteAllMembers } = useGroupSettingState();
// 监听数据变化
watch(isMuteAllMembers, (newValue) => {
console.log('isMuteAllMembers 更新:', newValue);
});
// 直接访问数据
console.log('当前 isMuteAllMembers:', isMuteAllMembers.value);
isInGroup
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { isInGroup } = useGroupSettingState();
// 监听数据变化
watch(isInGroup, (newValue) => {
console.log('isInGroup 更新:', newValue);
});
// 直接访问数据
console.log('当前 isInGroup:', isInGroup.value);
inviteOption
Ref<any>
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { inviteOption } = useGroupSettingState();
// 监听数据变化
watch(inviteOption, (newValue) => {
console.log('inviteOption 更新:', newValue);
});
// 直接访问数据
console.log('当前 inviteOption:', inviteOption.value);
接口函数
getGroupMemberList
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { getGroupMemberList } = useGroupSettingState();
// Get group member list
await getGroupMemberList({
groupId: 'group_123',
filter: 0,
nextSeq: 0
});
updateGroupProfile
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { updateGroupProfile } = useGroupSettingState();
// Update group profile
await updateGroupProfile({
groupId: 'group_123',
groupName: 'New Group Name',
avatar: 'https://example.com/avatar.png',
introduction: 'Welcome to our group!',
notification: 'Please follow the rules'
});
addGroupMember
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { addGroupMember } = useGroupSettingState();
// Add group members
await addGroupMember({
groupId: 'group_123',
userList: ['user_001', 'user_002']
});
deleteGroupMember
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { deleteGroupMember } = useGroupSettingState();
// Delete group members
await deleteGroupMember({
groupId: 'group_123',
userList: ['user_001'],
reason: 'Violated group rules'
});
changeGroupOwner
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { changeGroupOwner } = useGroupSettingState();
// Transfer group ownership
await changeGroupOwner({
groupId: 'group_123',
newOwnerUserId: 'user_456'
});
setGroupMemberRole
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { setGroupMemberRole } = useGroupSettingState();
// Set group member role (1: admin, 0: member)
await setGroupMemberRole({
groupId: 'group_123',
userId: 'user_456',
role: 1
});
setGroupMemberNameCard
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { setGroupMemberNameCard } = useGroupSettingState();
// Set group member name card
await setGroupMemberNameCard({
groupId: 'group_123',
userId: 'user_456',
nameCard: 'Team Leader'
});
setChatPinned
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { setChatPinned } = useGroupSettingState();
// Pin chat to top
await setChatPinned({
conversationId: 'C2C_user123',
isPinned: true
});
setChatMuted
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { setChatMuted } = useGroupSettingState();
// Mute chat notifications
await setChatMuted({
conversationId: 'C2C_user123',
isMuted: true
});
setGroupMemberMuteTime
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { setGroupMemberMuteTime } = useGroupSettingState();
// Mute group member for 10 minutes
await setGroupMemberMuteTime({
groupId: 'group_123',
userId: 'user_456',
muteTime: 600
});
setMuteAllMember
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { setMuteAllMember } = useGroupSettingState();
// Mute all group members
await setMuteAllMember({
groupId: 'group_123',
isMuted: true
});
dismissGroup
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { dismissGroup } = useGroupSettingState();
// Dismiss group
await dismissGroup({
groupId: 'group_123'
});
quitGroup
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { quitGroup } = useGroupSettingState();
// Quit group
await quitGroup({
groupId: 'group_123'
});
hasPermission
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { hasPermission } = useGroupSettingState();
// Check if user has permission
await hasPermission({
permission: 'kick_member'
});
canOperateOnMember
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { canOperateOnMember } = useGroupSettingState();
// Check if can operate on member
await canOperateOnMember({
targetUserId: 'user_456',
operation: 'mute'
});
getAvailablePermissions
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { getAvailablePermissions } = useGroupSettingState();
// Get available permissions for a user
await getAvailablePermissions({
userId: 'user_123'
});
initWatcher
示例
import { useGroupSettingState } from 'tuikit-atomicx-vue3';
const { initWatcher } = useGroupSettingState();
// Initialize group setting watcher
await initWatcher({
autoUpdate: true
});
VideoMixerState
🎬 视频混流管理模块
核心功能:管理视频混流功能,支持多路视频合成、布局管理、媒体源控制等高级视频处理功能。
技术特点:支持实时视频混流、动态布局调整、媒体源管理等功能。新增isVideoMixerEnabled、mediaSourceList、activeMediaSource响应式数据和完整的混流控制接口。
业务价值:为直播平台提供专业的视频制作能力,提升直播质量。
应用场景:多人直播、画中画、视频合成、专业制作等场景。
响应式数据
publishVideoQuality
Ref<any>
示例
const size = getSizeByResolution(TRTCVideoResolution.TRTCVideoResolution_1280_720);
console.log(size.width, size.height); // 输出: 1280, 720
isVideoMixerEnabled
Ref<any>
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { isVideoMixerEnabled } = useVideoMixerState();
// 监听数据变化
watch(isVideoMixerEnabled, (newValue) => {
console.log('isVideoMixerEnabled 更新:', newValue);
});
// 直接访问数据
console.log('当前 isVideoMixerEnabled:', isVideoMixerEnabled.value);
mediaSourceList
Ref<any>
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { mediaSourceList } = useVideoMixerState();
// 监听数据变化
watch(mediaSourceList, (newValue) => {
console.log('mediaSourceList 更新:', newValue);
});
// 直接访问数据
console.log('当前 mediaSourceList:', mediaSourceList.value);
activeMediaSource
Ref<any>
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { activeMediaSource } = useVideoMixerState();
// 监听数据变化
watch(activeMediaSource, (newValue) => {
console.log('activeMediaSource 更新:', newValue);
});
// 直接访问数据
console.log('当前 activeMediaSource:', activeMediaSource.value);
接口函数
getVideoDataByQuality
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { getVideoDataByQuality } = useVideoMixerState();
// Get video encoding parameters by quality
await getVideoDataByQuality({
quality: VideoQuality.HD720P
});
getSizeByQuality
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { getSizeByQuality } = useVideoMixerState();
// Get video size by quality
await getSizeByQuality({
quality: VideoQuality.HD720P
});
getSizeByResolution
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { getSizeByResolution } = useVideoMixerState();
// Get video size by resolution
await getSizeByResolution({
resolution: VideoResolution.Resolution_1280_720
});
transformTUIVideoQualityToTRTCVideoResolution
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { transformTUIVideoQualityToTRTCVideoResolution } = useVideoMixerState();
// Transform TUI video quality to TRTC resolution
await transformTUIVideoQualityToTRTCVideoResolution({
quality: VideoQuality.HD720P
});
transformTRTCVideoResolutionToTUIVideoQuality
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { transformTRTCVideoResolutionToTUIVideoQuality } = useVideoMixerState();
// Transform TRTC resolution to TUI video quality
await transformTRTCVideoResolutionToTUIVideoQuality({
resolution: TRTCVideoResolution.TRTCVideoResolution_1280_720
});
transformTRTCVideoResModeToTUIVideoResMode
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { transformTRTCVideoResModeToTUIVideoResMode } = useVideoMixerState();
// Transform TRTC resolution mode to TUI mode
await transformTRTCVideoResModeToTUIVideoResMode({
mode: TRTCVideoResMode.TRTCVideoResModeLandscape
});
changeActiveMediaSource
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { changeActiveMediaSource } = useVideoMixerState();
// Change active media source
await changeActiveMediaSource({
sourceId: 'camera_source_1'
});
updateVideoQuality
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { updateVideoQuality } = useVideoMixerState();
// Update video mixer quality
await updateVideoQuality({
quality: VideoQuality.HD1080P
});
getDefaultLayoutByMediaSource
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { getDefaultLayoutByMediaSource } = useVideoMixerState();
// Get default layout by media source type
await getDefaultLayoutByMediaSource({
sourceType: MediaSourceType.Camera
});
addMediaSource
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { addMediaSource } = useVideoMixerState();
// Add a camera media source
await addMediaSource({
sourceId: 'camera_source_1',
sourceType: 0,
sourceInfo: { deviceId: 'default' }
});
updateMediaSource
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { updateMediaSource } = useVideoMixerState();
// Update media source configuration
await updateMediaSource({
sourceId: 'camera_source_1',
sourceInfo: { x: 0, y: 0, width: 640, height: 480 }
});
removeMediaSource
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { removeMediaSource } = useVideoMixerState();
// Remove media source from mixer
await removeMediaSource({
sourceId: 'camera_source_1'
});
enableLocalVideoMixer
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { enableLocalVideoMixer } = useVideoMixerState();
// Enable local video mixer
await enableLocalVideoMixer({
enable: true
});
clearMediaSource
示例
// 清空所有媒体源
clearMediaSource();
initMediaSourceManager
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { initMediaSourceManager } = useVideoMixerState();
// Initialize media source manager
await initMediaSourceManager({
config: { maxSources: 4 }
});
initVideoMixerState
示例
import { useVideoMixerState } from 'tuikit-atomicx-vue3';
const { initVideoMixerState } = useVideoMixerState();
// Initialize video mixer state
await initVideoMixerState({
config: { defaultQuality: VideoQuality.HD720P }
});
VirtualBackgroundState
🖼️ 虚拟背景管理模块
核心功能:管理虚拟背景功能,支持背景替换、背景模糊、自定义背景等视频美化功能。
技术特点:基于AI技术实现实时背景分割和替换。新增virtualBackgroundConfig响应式数据和isSupported、setVirtualBackground接口函数。
业务价值:为用户提供隐私保护和视频美化功能,提升视频通话体验。
应用场景:视频通话、在线会议、直播美化、隐私保护等场景。
响应式数据
virtualBackgroundConfig
Ref<any>
示例
import { useVirtualBackgroundState } from 'tuikit-atomicx-vue3';
const { virtualBackgroundConfig } = useVirtualBackgroundState();
// 监听数据变化
watch(virtualBackgroundConfig, (newValue) => {
console.log('virtualBackgroundConfig 更新:', newValue);
});
// 直接访问数据
console.log('当前 virtualBackgroundConfig:', virtualBackgroundConfig.value);
接口函数
initVirtualBackground
示例
import { useVirtualBackgroundState } from 'tuikit-atomicx-vue3';
const { initVirtualBackground } = useVirtualBackgroundState();
// Initialize virtual background
await initVirtualBackground({
config: { enabled: true, type: 'blur' }
});
saveVirtualBackground
示例
import { useVirtualBackgroundState } from 'tuikit-atomicx-vue3';
const { saveVirtualBackground } = useVirtualBackgroundState();
// Save virtual background configuration
await saveVirtualBackground({
config: { enabled: true, type: 'image', imageUrl: 'https://example.com/bg.jpg' }
});
isSupported
示例
import { useVirtualBackgroundState } from 'tuikit-atomicx-vue3';
const { isSupported } = useVirtualBackgroundState();
// Check if virtual background is supported
await isSupported({
feature: 'blur'
});
setVirtualBackground
示例
import { useVirtualBackgroundState } from 'tuikit-atomicx-vue3';
const { setVirtualBackground } = useVirtualBackgroundState();
// Set virtual background (0: none, 1: blur, 2: image)
await setVirtualBackground({
backgroundType: 1,
backgroundValue: ''
});
ASRState
🎙️ 语音识别管理模块
核心功能:管理语音识别功能,支持实时语音转文字、转录历史管理、转录导出等功能。
技术特点:基于先进的ASR技术,支持多语言识别、实时转录、历史记录等功能。新增recentTranscripts、transcriptHistory响应式数据和exportTranscripts接口。
业务价值:为用户提供语音转文字服务,提升沟通效率和可访问性。
应用场景:会议记录、语音转录、无障碍通信、内容记录等场景。
响应式数据
recentTranscripts
Ref<any>
示例
import { useASRState } from 'tuikit-atomicx-vue3';
const { recentTranscripts } = useASRState();
// 监听数据变化
watch(recentTranscripts, (newValue) => {
console.log('recentTranscripts 更新:', newValue);
});
// 直接访问数据
console.log('当前 recentTranscripts:', recentTranscripts.value);
transcriptHistory
Ref<any>
示例
import { useASRState } from 'tuikit-atomicx-vue3';
const { transcriptHistory } = useASRState();
// 监听数据变化
watch(transcriptHistory, (newValue) => {
console.log('transcriptHistory 更新:', newValue);
});
// 直接访问数据
console.log('当前 transcriptHistory:', transcriptHistory.value);
接口函数
setRecentTranscriptsDuration
示例
import { useASRState } from 'tuikit-atomicx-vue3';
const { setRecentTranscriptsDuration } = useASRState();
// Set recent transcripts duration (in seconds)
await setRecentTranscriptsDuration({
duration: 300
});
clearHistory
示例
import { useASRState } from 'tuikit-atomicx-vue3';
const { clearHistory, transcriptHistory } = useASRState();
// 清空所有转录记录
clearHistory();
console.log('转录记录已清空:', transcriptHistory.value.length === 0);
exportTranscripts
示例
import { useASRState } from 'tuikit-atomicx-vue3';
const { exportTranscripts } = useASRState();
// Export transcripts in txt format
await exportTranscripts({
format: 'txt',
timeRange: { start: 1700000000000, end: 1700003600000 }
});
SearchState
🔍 搜索功能管理模块
核心功能:管理全局搜索功能,支持消息搜索、用户搜索、群组搜索等多维度搜索能力。
技术特点:支持高级搜索、搜索历史、搜索建议等功能。重构响应式数据为keyword、results、isLoading等标准化字段,提供完整的搜索接口。
业务价值:为用户提供快速查找信息的能力,提升使用效率。
应用场景:消息搜索、联系人搜索、内容查找、历史记录等场景。
响应式数据
keyword
Ref<any>
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { keyword } = useSearchState();
// 监听数据变化
watch(keyword, (newValue) => {
console.log('keyword 更新:', newValue);
});
// 直接访问数据
console.log('当前 keyword:', keyword.value);
results
Ref<any>
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { results } = useSearchState();
// 监听数据变化
watch(results, (newValue) => {
console.log('results 更新:', newValue);
});
// 直接访问数据
console.log('当前 results:', results.value);
isLoading
Ref<any>
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { isLoading } = useSearchState();
// 监听数据变化
watch(isLoading, (newValue) => {
console.log('isLoading 更新:', newValue);
});
// 直接访问数据
console.log('当前 isLoading:', isLoading.value);
error
Ref<any>
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { error } = useSearchState();
// 监听数据变化
watch(error, (newValue) => {
console.log('error 更新:', newValue);
});
// 直接访问数据
console.log('当前 error:', error.value);
searchAdvancedParams
Ref<any>
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { searchAdvancedParams } = useSearchState();
// 监听数据变化
watch(searchAdvancedParams, (newValue) => {
console.log('searchAdvancedParams 更新:', newValue);
});
// 直接访问数据
console.log('当前 searchAdvancedParams:', searchAdvancedParams.value);
selectedSearchType
Ref<any>
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { selectedSearchType } = useSearchState();
// 监听数据变化
watch(selectedSearchType, (newValue) => {
console.log('selectedSearchType 更新:', newValue);
});
// 直接访问数据
console.log('当前 selectedSearchType:', selectedSearchType.value);
接口函数
search
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { search } = useSearchState();
// Search for messages
await search({
keyword: 'meeting',
type: SearchType.Message
});
setKeyword
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { setKeyword } = useSearchState();
// Set search keyword
await setKeyword({
keyword: 'hello'
});
setSelectedType
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { setSelectedType } = useSearchState();
// Set selected search type
await setSelectedType({
searchType: 'message'
});
setSearchMessageAdvancedParams
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { setSearchMessageAdvancedParams } = useSearchState();
// Set message search advanced params
await setSearchMessageAdvancedParams({
conversationId: 'C2C_user123',
timeRange: { start: 1700000000000, end: 1700003600000 },
senderList: ['user_001', 'user_002']
});
setSearchUserAdvancedParams
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { setSearchUserAdvancedParams } = useSearchState();
// Set user search advanced params
await setSearchUserAdvancedParams({
userType: 'friend',
isOnline: true
});
setSearchGroupAdvancedParams
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { setSearchGroupAdvancedParams } = useSearchState();
// Set group search advanced params
await setSearchGroupAdvancedParams({
groupType: 'Public',
memberCountRange: { min: 10, max: 100 }
});
loadMore
示例
import { useSearchState } from 'tuikit-atomicx-vue3';
const { loadMore } = useSearchState();
// Load more search results
await loadMore({
cursor: 'next_page_cursor',
count: 20
});
SeatStore
🪑 座位存储管理模块
核心功能:提供座位状态的底层存储和管理,支持座位信息缓存、用户信息映射、设备请求处理等核心功能。
技术特点:采用响应式存储设计,支持实时状态同步、事件驱动更新等功能。新增liveOwnerUserId、localUserId、seatList等响应式数据和getUserInfo、convertUserInfoToAudienceInfo接口。
业务价值:为座位管理提供可靠的数据基础,确保座位状态的一致性。
应用场景:座位状态管理、用户信息存储、设备状态跟踪等底层场景。
响应式数据
liveOwnerUserId
Ref<any>
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { liveOwnerUserId } = useSeatStore();
// 监听数据变化
watch(liveOwnerUserId, (newValue) => {
console.log('liveOwnerUserId 更新:', newValue);
});
// 直接访问数据
console.log('当前 liveOwnerUserId:', liveOwnerUserId.value);
localUserId
Ref<any>
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { localUserId } = useSeatStore();
// 监听数据变化
watch(localUserId, (newValue) => {
console.log('localUserId 更新:', newValue);
});
// 直接访问数据
console.log('当前 localUserId:', localUserId.value);
seatList
Ref<any>
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { seatList } = useSeatStore();
// 监听数据变化
watch(seatList, (newValue) => {
console.log('seatList 更新:', newValue);
});
// 直接访问数据
console.log('当前 seatList:', seatList.value);
coHostUserList
Ref<any>
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { coHostUserList } = useSeatStore();
// 监听数据变化
watch(coHostUserList, (newValue) => {
console.log('coHostUserList 更新:', newValue);
});
// 直接访问数据
console.log('当前 coHostUserList:', coHostUserList.value);
sentDeviceRequestMap
Ref<any>
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { sentDeviceRequestMap } = useSeatStore();
// 监听数据变化
watch(sentDeviceRequestMap, (newValue) => {
console.log('sentDeviceRequestMap 更新:', newValue);
});
// 直接访问数据
console.log('当前 sentDeviceRequestMap:', sentDeviceRequestMap.value);
receivedDeviceRequestMap
Ref<any>
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { receivedDeviceRequestMap } = useSeatStore();
// 监听数据变化
watch(receivedDeviceRequestMap, (newValue) => {
console.log('receivedDeviceRequestMap 更新:', newValue);
});
// 直接访问数据
console.log('当前 receivedDeviceRequestMap:', receivedDeviceRequestMap.value);
userInfoMap
Ref<any>
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { userInfoMap } = useSeatStore();
// 监听数据变化
watch(userInfoMap, (newValue) => {
console.log('userInfoMap 更新:', newValue);
});
// 直接访问数据
console.log('当前 userInfoMap:', userInfoMap.value);
接口函数
getUserInfo
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { getUserInfo } = useSeatStore();
// Get user info by userId
await getUserInfo({
userId: 'user_123'
});
convertUserInfoToAudienceInfo
示例
import { useSeatStore } from 'tuikit-atomicx-vue3';
const { convertUserInfoToAudienceInfo } = useSeatStore();
// Convert user info to audience info format
await convertUserInfoToAudienceInfo({
userInfo: { userId: 'user_123', nickName: 'John', avatar: 'https://example.com/avatar.png' }
});