@tencentcloud/tuiroom-engine-js 3.5.0-beta.1 → 3.5.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +2 -2
- package/index.d.ts +269 -12
- package/index.esm.js +2 -2
- package/index.js +2 -2
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1310,17 +1310,26 @@ declare enum TUILiveListManagerEvents {
|
|
|
1310
1310
|
* @default 'onLiveInfoChanged'
|
|
1311
1311
|
* @event TUILiveListManagerEvents#onLiveInfoChanged
|
|
1312
1312
|
* @param {object} options
|
|
1313
|
-
* @param {
|
|
1314
|
-
* @param {TUILiveModifyFlag} options.modifyFlag 直播间修改标识
|
|
1313
|
+
* @param {TUILiveModifyInfo} options.liveModifyInfo 直播间变更信息
|
|
1315
1314
|
*
|
|
1316
1315
|
* @example
|
|
1317
1316
|
* const roomEngine = new TUIRoomEngine();
|
|
1318
1317
|
* const liveListManager = roomEngine.getLiveListManager();
|
|
1319
|
-
* liveListManager.on(TUILiveListManagerEvents.onLiveInfoChanged, ({
|
|
1320
|
-
* console.log('liveListManager.onLiveInfoChanged',
|
|
1318
|
+
* liveListManager.on(TUILiveListManagerEvents.onLiveInfoChanged, ({ liveModifyInfo}) => {
|
|
1319
|
+
* console.log('liveListManager.onLiveInfoChanged', liveModifyInfo);
|
|
1321
1320
|
* });
|
|
1322
1321
|
*/
|
|
1323
|
-
onLiveInfoChanged = "onLiveInfoChanged"
|
|
1322
|
+
onLiveInfoChanged = "onLiveInfoChanged",
|
|
1323
|
+
/**
|
|
1324
|
+
* @since v3.5.0
|
|
1325
|
+
* @description 直播间统计信息发生变化事件回调
|
|
1326
|
+
* @default 'onLiveStatisticsChanged'
|
|
1327
|
+
* @event TUILiveListManagerEvents#onLiveStatisticsChanged
|
|
1328
|
+
* @param {object} options
|
|
1329
|
+
* @param {string} options.roomId 直播间 ID
|
|
1330
|
+
* @param {TUILiveStatisticsData} options.statistics 直播间统计变更信息
|
|
1331
|
+
*/
|
|
1332
|
+
onLiveStatisticsChanged = "onLiveStatisticsChanged"
|
|
1324
1333
|
}
|
|
1325
1334
|
declare enum TUILiveLayoutManagerEvents {
|
|
1326
1335
|
/**
|
|
@@ -1416,14 +1425,27 @@ type TUISeatLayout = {
|
|
|
1416
1425
|
* @property {number} totalGiftCoins 礼物总价值
|
|
1417
1426
|
* @property {number} totalUniqueGiftSenders 礼物发送者总数
|
|
1418
1427
|
* @property {number} totalLikesReceived 点赞总数
|
|
1428
|
+
* @property {number} totalMessageCount 消息总数
|
|
1429
|
+
* @property {number} liveDuration 直播时长,单位秒
|
|
1419
1430
|
*/
|
|
1420
1431
|
type TUILiveStatisticsData = {
|
|
1421
|
-
totalViewers
|
|
1422
|
-
totalGiftsSent
|
|
1423
|
-
totalGiftCoins
|
|
1424
|
-
totalUniqueGiftSenders
|
|
1425
|
-
totalLikesReceived
|
|
1432
|
+
totalViewers?: number;
|
|
1433
|
+
totalGiftsSent?: number;
|
|
1434
|
+
totalGiftCoins?: number;
|
|
1435
|
+
totalUniqueGiftSenders?: number;
|
|
1436
|
+
totalLikesReceived?: number;
|
|
1437
|
+
totalMessageCount?: number;
|
|
1438
|
+
liveDuration?: number;
|
|
1426
1439
|
};
|
|
1440
|
+
declare enum TUILiveStatisticsModifyFlag {
|
|
1441
|
+
kNone = 0,
|
|
1442
|
+
kTotalViewers = 1,
|
|
1443
|
+
kTotalGiftsSent = 2,
|
|
1444
|
+
kTotalGiftCoins = 4,
|
|
1445
|
+
kTotalUniqueGiftSenders = 8,
|
|
1446
|
+
kTotalLikesReceived = 16,
|
|
1447
|
+
kTotalMessageCount = 32
|
|
1448
|
+
}
|
|
1427
1449
|
/**
|
|
1428
1450
|
* @since v3.0.5
|
|
1429
1451
|
* **TUILiveConnectionManager** 事件列表<br>
|
|
@@ -1738,6 +1760,84 @@ declare enum TUILiveBattleManagerEvents {
|
|
|
1738
1760
|
* });
|
|
1739
1761
|
*/
|
|
1740
1762
|
onBattleRequestReject = "onBattleRequestReject"
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* 礼物信息
|
|
1766
|
+
*/
|
|
1767
|
+
type GiftInfo = {
|
|
1768
|
+
giftID: string;
|
|
1769
|
+
name: string;
|
|
1770
|
+
desc: string;
|
|
1771
|
+
iconUrl: string;
|
|
1772
|
+
resourceUrl: string;
|
|
1773
|
+
level: number;
|
|
1774
|
+
coins: number;
|
|
1775
|
+
extensionInfo: Record<string, string>;
|
|
1776
|
+
};
|
|
1777
|
+
/**
|
|
1778
|
+
* 礼物分类信息
|
|
1779
|
+
*/
|
|
1780
|
+
type GiftCategory = {
|
|
1781
|
+
categoryID: string;
|
|
1782
|
+
name: string;
|
|
1783
|
+
desc: string;
|
|
1784
|
+
extensionInfo: Record<string, string>;
|
|
1785
|
+
giftList: GiftInfo[];
|
|
1786
|
+
};
|
|
1787
|
+
declare enum TUILiveGiftManagerEvents {
|
|
1788
|
+
/**
|
|
1789
|
+
* @description 接收到礼物数量发送变化监听事件
|
|
1790
|
+
* @default 'onGiftCountChanged'
|
|
1791
|
+
* @event TUILiveGiftManagerEvents#onGiftCountChanged
|
|
1792
|
+
* @param {object} options
|
|
1793
|
+
* @param {String} roomId 房间Id
|
|
1794
|
+
* @param {Number} totalGiftsSent 总礼物数
|
|
1795
|
+
* @param {Number} totalGiftCoins 总礼物价值
|
|
1796
|
+
* @param {Number} totalUniqueGiftSenders 总礼物发送者数量
|
|
1797
|
+
*
|
|
1798
|
+
* @example
|
|
1799
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1800
|
+
* const liveGiftManager = roomEngine.TUILiveGiftManager();
|
|
1801
|
+
* liveGiftManager.on(TUILiveGiftManagerEvents.onGiftCountChanged, ({ roomId, totalGiftsSent, totalGiftCoins, totalUniqueGiftSenders }) => {
|
|
1802
|
+
* console.log('liveGiftManager.onGiftCountChanged', roomId, totalGiftsSent, totalGiftCoins, totalUniqueGiftSenders);
|
|
1803
|
+
* });
|
|
1804
|
+
*/
|
|
1805
|
+
onGiftCountChanged = "onGiftCountChanged",
|
|
1806
|
+
/**
|
|
1807
|
+
* @description 接收到礼物消息的监听事件
|
|
1808
|
+
* @default 'onReceiveGiftMessage'
|
|
1809
|
+
* @event TUILiveGiftManagerEvents#onReceiveGiftMessage
|
|
1810
|
+
* @param {object} options
|
|
1811
|
+
* @param {String} roomId 房间Id
|
|
1812
|
+
* @param {GiftInfo} giftInfo 礼物信息
|
|
1813
|
+
* @param {number} count 礼物数量
|
|
1814
|
+
* @param {TUIUserInfo} sender 发送者信息
|
|
1815
|
+
*
|
|
1816
|
+
* @example
|
|
1817
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1818
|
+
* const liveGiftManager = roomEngine.TUILiveGiftManager();
|
|
1819
|
+
* liveGiftManager.on(TUILiveGiftManagerEvents.onReceiveGiftMessage, ({ roomId, giftInfo, count, sender }) => {
|
|
1820
|
+
* console.log('liveGiftManager.onReceiveGiftMessage', roomId, giftInfo, count, sender);
|
|
1821
|
+
* });
|
|
1822
|
+
*/
|
|
1823
|
+
onReceiveGiftMessage = "onReceiveGiftMessage",
|
|
1824
|
+
/**
|
|
1825
|
+
* @description 接收到点赞消息的监听事件
|
|
1826
|
+
* @default 'onReceiveLikesMessage'
|
|
1827
|
+
* @event TUILiveGiftManagerEvents#onReceiveLikesMessage
|
|
1828
|
+
* @param {object} options
|
|
1829
|
+
* @param {String} roomId 房间Id
|
|
1830
|
+
* @param {number} totalLikesReceived 总点赞数
|
|
1831
|
+
* @param {TUIUserInfo} sender 发送者信息
|
|
1832
|
+
*
|
|
1833
|
+
* @example
|
|
1834
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1835
|
+
* const liveGiftManager = roomEngine.TUILiveGiftManager();
|
|
1836
|
+
* liveGiftManager.on(TUILiveGiftManagerEvents.onReceiveLikesMessage, ({ roomId, totalLikesReceived, sender }) => {
|
|
1837
|
+
* console.log('liveGiftManager.onReceiveLikesMessage', roomId, totalLikesReceived, sender);
|
|
1838
|
+
* });
|
|
1839
|
+
*/
|
|
1840
|
+
onReceiveLikesMessage = "onReceiveLikesMessage"
|
|
1741
1841
|
}
|
|
1742
1842
|
|
|
1743
1843
|
declare class Logger {
|
|
@@ -2955,6 +3055,151 @@ declare class TUILiveBattleManager {
|
|
|
2955
3055
|
private observerFunction;
|
|
2956
3056
|
}
|
|
2957
3057
|
|
|
3058
|
+
declare class TUILiveGiftManager {
|
|
3059
|
+
private liveGiftManagerWASM;
|
|
3060
|
+
private logger;
|
|
3061
|
+
private static liveGiftManager;
|
|
3062
|
+
constructor(options: {
|
|
3063
|
+
Module: any;
|
|
3064
|
+
logger: Logger;
|
|
3065
|
+
roomEngineWASM: any;
|
|
3066
|
+
});
|
|
3067
|
+
/**
|
|
3068
|
+
* 获取礼物列表
|
|
3069
|
+
*
|
|
3070
|
+
* @param {object} options
|
|
3071
|
+
* @param {String} options.roomId 房间ID
|
|
3072
|
+
* @returns {Promise<{giftCategoryList: GiftCategory[]}>}
|
|
3073
|
+
*
|
|
3074
|
+
* @example
|
|
3075
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3076
|
+
* const liveGiftManager = roomEngine.getLiveGiftManager();
|
|
3077
|
+
* liveGiftManager.getGiftList({
|
|
3078
|
+
* roomId: 'roomId'
|
|
3079
|
+
* });
|
|
3080
|
+
*/
|
|
3081
|
+
getGiftList(options: {
|
|
3082
|
+
roomId: string;
|
|
3083
|
+
}): Promise<{
|
|
3084
|
+
giftCategoryList: GiftCategory[];
|
|
3085
|
+
}>;
|
|
3086
|
+
/**
|
|
3087
|
+
* 发送礼物
|
|
3088
|
+
*
|
|
3089
|
+
* @param {object} options
|
|
3090
|
+
* @param {string} options.roomId 房间ID
|
|
3091
|
+
* @param {string} options.giftId 礼物ID
|
|
3092
|
+
* @param {number} options.count 礼物数量
|
|
3093
|
+
* @returns {Promise<void>}
|
|
3094
|
+
*
|
|
3095
|
+
* @example
|
|
3096
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3097
|
+
* const liveGiftManager = roomEngine.getLiveGiftManager();
|
|
3098
|
+
* liveGiftManager.sendGift({
|
|
3099
|
+
* roomId: 'roomId',
|
|
3100
|
+
* giftId: 'giftId',
|
|
3101
|
+
* count: 1
|
|
3102
|
+
* });
|
|
3103
|
+
*/
|
|
3104
|
+
sendGift(options: {
|
|
3105
|
+
roomId: string;
|
|
3106
|
+
giftId: string;
|
|
3107
|
+
count: number;
|
|
3108
|
+
}): Promise<void>;
|
|
3109
|
+
/**
|
|
3110
|
+
* 发送点赞
|
|
3111
|
+
*
|
|
3112
|
+
* @param {object} options
|
|
3113
|
+
* @param {string} options.roomId 房间ID
|
|
3114
|
+
* @param {number} options.count 点赞数量
|
|
3115
|
+
* @returns {Promise<void>}
|
|
3116
|
+
*
|
|
3117
|
+
* @example
|
|
3118
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3119
|
+
* const liveGiftManager = roomEngine.getLiveGiftManager();
|
|
3120
|
+
* liveGiftManager.sendLikes({
|
|
3121
|
+
* roomId: 'roomId',
|
|
3122
|
+
* count: 1
|
|
3123
|
+
* });
|
|
3124
|
+
*/
|
|
3125
|
+
sendLikes(options: {
|
|
3126
|
+
roomId: string;
|
|
3127
|
+
count: number;
|
|
3128
|
+
}): Promise<void>;
|
|
3129
|
+
/**
|
|
3130
|
+
* 获取礼物数量
|
|
3131
|
+
*
|
|
3132
|
+
* @param {object} options
|
|
3133
|
+
* @param {string} options.roomId 房间ID
|
|
3134
|
+
* @returns {Promise<{totalGiftCoins:number, totalGiftsSent: number, totalUniqueGiftSenders: number}>}
|
|
3135
|
+
*
|
|
3136
|
+
* @example
|
|
3137
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3138
|
+
* const liveGiftManager = roomEngine.getLiveGiftManager();
|
|
3139
|
+
* liveGiftManager.getGiftCountByAnchor({
|
|
3140
|
+
* roomId: 'roomId'
|
|
3141
|
+
* });
|
|
3142
|
+
*/
|
|
3143
|
+
getGiftCountByAnchor(options: {
|
|
3144
|
+
roomId: string;
|
|
3145
|
+
}): Promise<{
|
|
3146
|
+
totalGiftCoins: number;
|
|
3147
|
+
totalGiftsSent: number;
|
|
3148
|
+
totalUniqueGiftSenders: number;
|
|
3149
|
+
}>;
|
|
3150
|
+
/**
|
|
3151
|
+
* 获取点赞数量
|
|
3152
|
+
*
|
|
3153
|
+
* @param {object} options
|
|
3154
|
+
* @param {string} options.roomId 房间ID
|
|
3155
|
+
* @returns {Promise<{totalLikesReceived: number}>}
|
|
3156
|
+
*
|
|
3157
|
+
* @example
|
|
3158
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3159
|
+
* const liveGiftManager = roomEngine.getLiveGiftManager();
|
|
3160
|
+
* liveGiftManager.getLikesCount({
|
|
3161
|
+
* roomId: 'roomId'
|
|
3162
|
+
* });
|
|
3163
|
+
*/
|
|
3164
|
+
getLikesCount(options: {
|
|
3165
|
+
roomId: string;
|
|
3166
|
+
}): Promise<{
|
|
3167
|
+
totalLikesReceived: number;
|
|
3168
|
+
}>;
|
|
3169
|
+
/**
|
|
3170
|
+
* 监听 TUILiveGiftManager 事件
|
|
3171
|
+
* @param {TUILiveGiftManagerEvents} event 事件名
|
|
3172
|
+
* @param func 事件回调函数
|
|
3173
|
+
*
|
|
3174
|
+
* @example
|
|
3175
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3176
|
+
* const liveGiftManager = roomEngine.getLiveGiftManager();
|
|
3177
|
+
*
|
|
3178
|
+
* const callback = ({ roomId, totalGiftsSent, totalGiftCoins, totalUniqueGiftSenders }) => {
|
|
3179
|
+
* console.log('Demo onGiftCountChanged', { roomId, totalGiftsSent, totalGiftCoins, totalUniqueGiftSenders });
|
|
3180
|
+
* }
|
|
3181
|
+
* liveGiftManager.on(TUILiveGiftManagerEvents.onGiftCountChanged, callback);
|
|
3182
|
+
*/
|
|
3183
|
+
on(event: TUILiveGiftManagerEvents, func: (...args: any[]) => void): void;
|
|
3184
|
+
/**
|
|
3185
|
+
* 取消监听 TUIliveGiftManager 事件
|
|
3186
|
+
* @param {TUILiveGiftManagerEvents} event 事件名
|
|
3187
|
+
* @param func 事件回调函数
|
|
3188
|
+
*
|
|
3189
|
+
* @example
|
|
3190
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3191
|
+
* const liveGiftManager = roomEngine.getLiveGiftManager();
|
|
3192
|
+
*
|
|
3193
|
+
* const callback = ({ roomId, totalGiftsSent, totalGiftCoins, totalUniqueGiftSenders }) => {
|
|
3194
|
+
* console.log('Demo onGiftCountChanged', { roomId, totalGiftsSent, totalGiftCoins, totalUniqueGiftSenders });
|
|
3195
|
+
* }
|
|
3196
|
+
* liveGiftManager.off(TUILiveGiftManagerEvents.onGiftCountChanged, callback);
|
|
3197
|
+
*/
|
|
3198
|
+
off(event: TUILiveGiftManagerEvents, func: (...args: any[]) => void): void;
|
|
3199
|
+
private JSCallNativeFunctionPromise;
|
|
3200
|
+
private observerFunction;
|
|
3201
|
+
}
|
|
3202
|
+
|
|
2958
3203
|
/**
|
|
2959
3204
|
* TUIRoomEngine 提供了音视频房间的能力
|
|
2960
3205
|
*
|
|
@@ -2973,6 +3218,7 @@ declare class TUIRoomEngine {
|
|
|
2973
3218
|
private liveLayoutManager;
|
|
2974
3219
|
private liveConnectionManager;
|
|
2975
3220
|
private liveBattleManager;
|
|
3221
|
+
private liveGiftManager;
|
|
2976
3222
|
private static userId;
|
|
2977
3223
|
private static sdkAppId;
|
|
2978
3224
|
private static Module;
|
|
@@ -4454,6 +4700,17 @@ declare class TUIRoomEngine {
|
|
|
4454
4700
|
* const liveBattleManager = roomEngine.getLiveBattleManager();
|
|
4455
4701
|
*/
|
|
4456
4702
|
getLiveBattleManager(): TUILiveBattleManager;
|
|
4703
|
+
/**
|
|
4704
|
+
* v3.4.4 版本起支持 getLiveGiftManager 获取 TUILiveGiftManager 模块
|
|
4705
|
+
*
|
|
4706
|
+
* @since v3.4.4
|
|
4707
|
+
* @returns {TUILiveGiftManager}
|
|
4708
|
+
*
|
|
4709
|
+
* @example
|
|
4710
|
+
* const roomEngine = new TUIRoomEngine();
|
|
4711
|
+
* const liveGiftManager = roomEngine.getLiveGiftManager();
|
|
4712
|
+
*/
|
|
4713
|
+
getLiveGiftManager(): TUILiveGiftManager;
|
|
4457
4714
|
/**
|
|
4458
4715
|
* v2.6.0 版本起支持使用 getConferenceInvitationManager 获取 conferenceInvitation 模块
|
|
4459
4716
|
* @since v2.6.0
|
|
@@ -4503,5 +4760,5 @@ declare class TUIRoomEngine {
|
|
|
4503
4760
|
private static handleSetFramework;
|
|
4504
4761
|
}
|
|
4505
4762
|
|
|
4506
|
-
export { TRTCRole, TUIAudioQuality, TUIAudioRoute, TUIBattleCode, TUIBattleStoppedReason, TUICaptureSourceType, TUIChangeReason, TUIConferenceCancelReason, TUIConferenceInvitationManager, TUIConferenceInvitationManagerEvents, TUIConferenceListManager, TUIConferenceListManagerEvents, TUIConferenceStatus, TUIConnectionCode, TUIDeviceStatus, TUIErrorCode, TUIInvitationCode, TUIInvitationRejectedReason, TUIInvitationStatus, TUIKickedOutOfRoomReason, TUILiveBattleManagerEvents, TUILiveConnectionManagerEvents, TUILiveLayoutManager, TUILiveLayoutManagerEvents, TUILiveListManager, TUILiveListManagerEvents, TUILiveModifyFlag, TUIMediaDevice, TUIMediaDeviceState, TUIMediaDeviceType, TUIMoveSeatPolicy, TUINetworkQuality, TUIRenderMode, TUIRequestAction, TUIRequestCallbackType, TUIResolutionMode, TUIRole, TUIRoomDeviceManager, TUIRoomDeviceMangerEvents, TUIRoomDismissedReason, TUIRoomEvents, TUIRoomType, TUISeatMode, TUIVideoQuality, TUIVideoStreamType, TUIRoomEngine as default };
|
|
4507
|
-
export type { StartLiveOptions, TUIAutoPlayCallbackInfo, TUIBattleConfig, TUIBattleInfo, TUIBattleUser, TUIConferenceInfo, TUIConferenceModifyInfo, TUIDeviceInfo, TUIEnterRoomOptions, TUIInvitation, TUILiveConnectionUser, TUILiveInfo, TUILiveListResult, TUILiveModifyInfo, TUILiveStatisticsData, TUILoginUserInfo, TUIMessage, TUINetwork, TUIRequest, TUIRequestCallback, TUIRoomInfo, TUISeatInfo, TUISeatLayout, TUISeatLockParams, TUISeatRegion, TUIUserInfo, TUIVideoEncoderParams };
|
|
4763
|
+
export { TRTCRole, TUIAudioQuality, TUIAudioRoute, TUIBattleCode, TUIBattleStoppedReason, TUICaptureSourceType, TUIChangeReason, TUIConferenceCancelReason, TUIConferenceInvitationManager, TUIConferenceInvitationManagerEvents, TUIConferenceListManager, TUIConferenceListManagerEvents, TUIConferenceStatus, TUIConnectionCode, TUIDeviceStatus, TUIErrorCode, TUIInvitationCode, TUIInvitationRejectedReason, TUIInvitationStatus, TUIKickedOutOfRoomReason, TUILiveBattleManagerEvents, TUILiveConnectionManagerEvents, TUILiveGiftManagerEvents, TUILiveLayoutManager, TUILiveLayoutManagerEvents, TUILiveListManager, TUILiveListManagerEvents, TUILiveModifyFlag, TUILiveStatisticsModifyFlag, TUIMediaDevice, TUIMediaDeviceState, TUIMediaDeviceType, TUIMoveSeatPolicy, TUINetworkQuality, TUIRenderMode, TUIRequestAction, TUIRequestCallbackType, TUIResolutionMode, TUIRole, TUIRoomDeviceManager, TUIRoomDeviceMangerEvents, TUIRoomDismissedReason, TUIRoomEvents, TUIRoomType, TUISeatMode, TUIVideoQuality, TUIVideoStreamType, TUIRoomEngine as default };
|
|
4764
|
+
export type { GiftCategory, GiftInfo, StartLiveOptions, TUIAutoPlayCallbackInfo, TUIBattleConfig, TUIBattleInfo, TUIBattleUser, TUIConferenceInfo, TUIConferenceModifyInfo, TUIDeviceInfo, TUIEnterRoomOptions, TUIInvitation, TUILiveConnectionUser, TUILiveInfo, TUILiveListResult, TUILiveModifyInfo, TUILiveStatisticsData, TUILoginUserInfo, TUIMessage, TUINetwork, TUIRequest, TUIRequestCallback, TUIRoomInfo, TUISeatInfo, TUISeatLayout, TUISeatLockParams, TUISeatRegion, TUIUserInfo, TUIVideoEncoderParams };
|