新增功能
This commit is contained in:
Generated
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
import { CallStatus, CallRole } from '../const/index';
|
||||
|
||||
type SDKAppID = { SDKAppID: number; } | { sdkAppID: number; };
|
||||
export interface IInitParamsBase {
|
||||
userID: string;
|
||||
userSig: string;
|
||||
tim?: any;
|
||||
isFromChat?: boolean;
|
||||
component?: number;
|
||||
}
|
||||
export type IInitParams = IInitParamsBase & SDKAppID;
|
||||
// calls params interface
|
||||
export interface ICallsParams {
|
||||
userIDList: Array<string>;
|
||||
type: number;
|
||||
chatGroupID?: string;
|
||||
roomID?: number;
|
||||
strRoomID?: string;
|
||||
userData?: string;
|
||||
timeout?: number;
|
||||
offlinePushInfo?: IOfflinePushInfo;
|
||||
}
|
||||
// userInfo interface
|
||||
export interface IUserInfo {
|
||||
userId: string;
|
||||
nick?: string;
|
||||
avatar?: string;
|
||||
remark?: string;
|
||||
displayUserInfo?: string; // 远端用户信息展示: remark -> nick -> userId, 简化 UI 组件; 本地用户信息展示: nick -> userId
|
||||
isAudioAvailable?: boolean; // 用来设置: 麦克风是否打开
|
||||
isVideoAvailable?: boolean; // 用来设置: 摄像头是否打开
|
||||
volume?: number;
|
||||
isEnter?: boolean; // 远端用户, 用来控制预览远端是否显示 loading 效果; 本地用户, 用来控制 "呼叫"、"接通" 接通后显示的 loading 效果
|
||||
domId?: string; // 播放流 dom 节点, localUserInfo 的 domId = 'localVideo'; remoteUserInfo 的 domId 就是 userId
|
||||
}
|
||||
export interface IOfflinePushInfo {
|
||||
title?: string,
|
||||
description?: string,
|
||||
androidOPPOChannelID?: string,
|
||||
extension: String
|
||||
}
|
||||
export interface ICallbackParam {
|
||||
beforeCalling?: (...args: any[]) => void;
|
||||
afterCalling?: (...args: any[]) => void;
|
||||
onMinimized?: (...args: any[]) => void;
|
||||
onMessageSentByMe?: (...args: any[]) => void;
|
||||
kickedOut?: (...args: any[]) => void;
|
||||
statusChanged?: (...args: any[]) => void;
|
||||
}
|
||||
|
||||
export interface ISelfInfoParams {
|
||||
nickName: string;
|
||||
avatar: string;
|
||||
}
|
||||
|
||||
export interface IBellParams {
|
||||
callRole?: CallRole;
|
||||
callStatus?: CallStatus;
|
||||
isMuteBell?: boolean;
|
||||
calleeBellFilePath?: string;
|
||||
}
|
||||
export interface IInviteUserParams {
|
||||
userIDList: string[];
|
||||
offlinePushInfo?: IOfflinePushInfo;
|
||||
}
|
||||
|
||||
export interface INetWorkQuality {
|
||||
userId: string;
|
||||
quality: number
|
||||
}
|
||||
Generated
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
import { CallStatus, CallRole, CallMediaType, VideoDisplayMode, VideoResolution, TDeviceList, CameraPosition, ICustomUIConfig } from '../const/index';
|
||||
import { IUserInfo, INetWorkQuality } from './index';
|
||||
|
||||
export interface IToastInfo {
|
||||
text: string;
|
||||
type?: string; // 默认 info 通知, 取值: 'info' | 'warn' | 'success' | 'error'
|
||||
}
|
||||
export interface ICallStore {
|
||||
callStatus: CallStatus; // 当前的通话状态, 默认: 'idle'
|
||||
callRole: CallRole; // 通话角色, 默认: 'callee'
|
||||
callMediaType: CallMediaType; // 通话类型
|
||||
localUserInfo: IUserInfo; // 自己的信息, 默认: { userId: '' }
|
||||
localUserInfoExcludeVolume: IUserInfo; // 不包含音量的当前用户信息
|
||||
remoteUserInfoList: Array<IUserInfo>; // 远端用户信息列表, 默认: []
|
||||
remoteUserInfoExcludeVolumeList: Array<IUserInfo>; // 不包含音量的远端用户信息列表
|
||||
// 被叫在未接通时,展示主叫的 userId、头像。但是如果主叫进入通话后再挂断,此时被叫无法知道主叫的信息了。
|
||||
// 因为目前 store 中仅提供了 remoteUserInfoList 数据,主叫离开后,被叫就没有主叫的信息了。因此考虑在 store 中增加 callerUserInfo 字段。
|
||||
callerUserInfo: IUserInfo;
|
||||
isGroup: boolean; // 是否是群组通话, 默认: false
|
||||
callDuration: string; // 通话时长, 默认: '00:00:00'
|
||||
callTips: string; // 通话提示的信息. 例如: '等待谁接听', 'xxx 拒绝通话', 'xxx 挂断通话'
|
||||
toastInfo: IToastInfo; // 远端用户挂断、拒绝、超时、忙线等的 toast 提示信息
|
||||
isMinimized: boolean; // 当前是否悬浮窗模式, 默认: false
|
||||
enableFloatWindow: boolean, // 开启/关闭悬浮窗功能,默认: false
|
||||
bigScreenUserId: string, // 当前大屏幕显示的 userID 用户
|
||||
language: string; // 当前语言
|
||||
isClickable: boolean; // 按钮是否可点击(呼叫后, '挂断' 按钮不可点击, 发送信令后才可以点击)
|
||||
showPermissionTip: boolean; // 设备权限弹窗是否展示(如果有麦克风权限为 false,如果没有麦克风也没有摄像头权限为 true)
|
||||
netWorkQualityList: Array<INetWorkQuality>; // 通话中用户的网络状态
|
||||
deviceList: TDeviceList;
|
||||
callID: string; // callEngine v3.1 support
|
||||
groupID: string;
|
||||
roomID: number | string;
|
||||
roomIdType: number;
|
||||
cameraPosition: CameraPosition; // 前置或后置,值为front, back
|
||||
isMuteSpeaker: boolean;
|
||||
groupCallMembers: IUserInfo[]; // chat 群会话中在通话的成员
|
||||
// TUICallKit 组件上的属性
|
||||
displayMode: VideoDisplayMode; // 设置预览远端的画面显示模式, 默认: VideoDisplayMode.COVER
|
||||
videoResolution: VideoResolution; // 设置视频分辨率, 默认: VideoResolution.RESOLUTION_720P
|
||||
// 小程序相关属性
|
||||
pusher: any;
|
||||
player: any[];
|
||||
isEarPhone: boolean; // 是否是听筒, 默认: false
|
||||
showSelectUser: boolean;
|
||||
// 是否开启虚拟背景, 目前仅 web 支持
|
||||
isShowEnableVirtualBackground: boolean, // 是否显示虚拟背景图标, 默认: false
|
||||
enableVirtualBackground: boolean, // 是否开启虚拟背景, 默认: false
|
||||
// customUIConfig
|
||||
customUIConfig: ICustomUIConfig,
|
||||
pusherId: string, // 重新渲染 live-Pusher 的标识位
|
||||
// translate function
|
||||
translate: Function,
|
||||
isForceUseV2API: boolean, // 是否使用 call/groupCall 接口, 默认: false
|
||||
}
|
||||
Generated
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @interface TUIGlobal
|
||||
* @property {Object} global 根据运行环境代理 wx、uni、window
|
||||
* @property {Boolean} isPC true 标识是 pc 网页
|
||||
* @property {Boolean} isH5 true 标识是 手机 H5
|
||||
* @property {Boolean} isWeChat true 标识是 微信小程序
|
||||
* @property {Boolean} isApp true 标识是 uniapp 打包的 native app
|
||||
* @property {Boolean} isUniPlatform true 标识当前应用是通过 uniapp 平台打包的产物
|
||||
* @property {Boolean} isOfficial true 标识是腾讯云官网 Demo 应用
|
||||
* @property {Boolean} isWIN true 标识是window系统pc
|
||||
* @property {Boolean} isMAC true 标识是mac os系统pc
|
||||
*/
|
||||
export interface ITUIGlobal {
|
||||
global: any; // 挂在 wx、uni、window 对象
|
||||
isPC: boolean;
|
||||
isH5: boolean;
|
||||
isWeChat: boolean;
|
||||
isApp: boolean;
|
||||
isUniPlatform: boolean;
|
||||
isOfficial: boolean;
|
||||
isWIN: boolean;
|
||||
isMAC: boolean;
|
||||
/**
|
||||
* 初始化 TUIGlobal 环境变量
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
initEnv(): void;
|
||||
/**
|
||||
* 初始化 isOfficial
|
||||
* @function
|
||||
* @param {number} SDKAppID 当前实例的应用 SDKAppID
|
||||
* @private
|
||||
*/
|
||||
initOfficial(SDKAppID: number): void;
|
||||
}
|
||||
Generated
Vendored
+87
@@ -0,0 +1,87 @@
|
||||
import { StoreName } from '../const/index';
|
||||
|
||||
// 此处 Map 的 value = 1 为占位作用
|
||||
export type Task = Record<StoreName, Record<string, Map<(data?: unknown) => void, 1>>>
|
||||
|
||||
export interface IOptions {
|
||||
[key: string]: (newData?: any) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @class TUIStore
|
||||
* @property {ICustomStore} customStore 自定义 store,可根据业务需要通过以下 API 进行数据操作。
|
||||
*/
|
||||
export interface ITUIStore {
|
||||
task: Task;
|
||||
/**
|
||||
* UI 组件注册监听
|
||||
* @function
|
||||
* @param {StoreName} storeName store 名称
|
||||
* @param {IOptions} options UI 组件注册的监听信息
|
||||
* @param {Object} params 扩展参数
|
||||
* @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围
|
||||
* @example
|
||||
* // UI 层监听会话列表更新通知
|
||||
* let onConversationListUpdated = function(conversationList) {
|
||||
* console.warn(conversationList);
|
||||
* }
|
||||
* TUIStore.watch(StoreName.CONV, {
|
||||
* conversationList: onConversationListUpdated,
|
||||
* })
|
||||
*/
|
||||
watch(storeName: StoreName, options: IOptions, params?: any): void;
|
||||
/**
|
||||
* UI 组件取消监听回调
|
||||
* @function
|
||||
* @param {StoreName} storeName store 名称
|
||||
* @param {IOptions} options 监听信息,包含需要取消的回调等
|
||||
* @example
|
||||
* // UI 层取消监听会话列表更新通知
|
||||
* TUIStore.unwatch(StoreName.CONV, {
|
||||
* conversationList: onConversationListUpdated,
|
||||
* })
|
||||
*/
|
||||
unwatch(storeName: StoreName, options: IOptions | string): void;
|
||||
/**
|
||||
* 获取 store 中的上一个状态
|
||||
* @function
|
||||
* @param {StoreName} storeName store 名称
|
||||
* @param {String} key 需要获取的 key
|
||||
* @private
|
||||
*/
|
||||
getPrevData(storeName: StoreName, key: string): any;
|
||||
/**
|
||||
* 获取 store 中的数据
|
||||
* @function
|
||||
* @param {StoreName} storeName store 名称
|
||||
* @param {String} key 需要获取的 key
|
||||
* @private
|
||||
*/
|
||||
getData(storeName: StoreName, key: string): any;
|
||||
/**
|
||||
* 更新 store
|
||||
* - 需要使用自定义 store 时可以用此 API 更新自定义数据
|
||||
* @function
|
||||
* @param {StoreName} storeName store 名称
|
||||
* @param {String} key 需要更新的 key
|
||||
* @example
|
||||
* // UI 层更新自定义 Store 数据
|
||||
* TUIStore.update(StoreName.CUSTOM, 'customKey', 'customData')
|
||||
*/
|
||||
update(storeName: StoreName, key: string, data: unknown): void;
|
||||
/**
|
||||
* 重置 store 内数据
|
||||
* @function
|
||||
* @param {StoreName} storeName store 名称
|
||||
* @param {Array<string>} keyList 需要 reset 的 keyList
|
||||
* @param {boolean} isNotificationNeeded 是否需要触发更新
|
||||
* @private
|
||||
*/
|
||||
reset: (storeName: StoreName, keyList?: Array<string>, isNotificationNeeded?: boolean) => void;
|
||||
/**
|
||||
* 修改多个 key-value
|
||||
* @param {Object} params 多个 key-value 组成的 object
|
||||
* @param {StoreName} storeName store 名称
|
||||
*/
|
||||
updateStore: (params: any, name?: StoreName) => void;
|
||||
}
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
export * from './ICallService';
|
||||
export * from './ICallStore';
|
||||
export * from './ITUIGlobal';
|
||||
export * from './ITUIStore';
|
||||
Reference in New Issue
Block a user