This commit is contained in:
zoujiandong
2024-01-12 09:38:24 +08:00
parent efb6a9aacf
commit 360c1bb977
301 changed files with 19221 additions and 986 deletions
@@ -0,0 +1,93 @@
import { CallStatus, CallRole } from '../const/index';
/**
* @interface ITUICallService
*/
export interface ITUICallService {
/**
* 初始化 Service
* @function
* @private
*/
init(params: any): void;
/**
* 1v1 通话
* @function
* @param {SwitchUserStatusParams} options 用户状态控制参数
*/
call(callParams: ICallParams): void;
}
type SDKAppID = {
SDKAppID: number;
} | {
sdkAppID: number;
};
export interface IInitParamsBase {
userID: string;
userSig: string;
tim?: any;
isFromChat?: boolean;
}
export type IInitParams = IInitParamsBase & SDKAppID;
export interface ICallParams {
userID: string;
type: number;
roomID?: number;
userData?: string;
timeout?: number;
offlinePushInfo?: IOfflinePushInfo;
}
export interface IGroupCallParams {
userIDList: Array<string>;
type: number;
groupID: string;
roomID?: number;
userData?: string;
timeout?: number;
offlinePushInfo?: IOfflinePushInfo;
}
export interface IUserInfo {
userId: string;
nick?: string;
avatar?: string;
remark?: string;
displayUserInfo?: string;
isAudioAvailable?: boolean;
isVideoAvailable?: boolean;
volume?: number;
isEnter?: boolean;
domId?: string;
}
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 IJoinInGroupCallParams {
type: number;
groupID: string;
roomID: number;
}
export {};
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,33 @@
import { CallStatus, CallRole, CallMediaType, VideoDisplayMode, VideoResolution, TDeviceList } from '../const/index';
import { IUserInfo } from './index';
export interface IToastInfo {
text: string;
type?: string;
}
export interface ICallStore {
callStatus: CallStatus;
callRole: CallRole;
callMediaType: CallMediaType;
localUserInfo: IUserInfo;
remoteUserInfoList: Array<IUserInfo>;
callerUserInfo: IUserInfo;
isGroup: boolean;
callDuration: string;
callTips: string;
toastInfo: IToastInfo;
isMinimized: boolean;
enableFloatWindow: boolean;
bigScreenUserId: string;
language: string;
isClickable: boolean;
showPermissionTip: boolean;
deviceList: TDeviceList;
groupID: string;
roomID: number;
displayMode: VideoDisplayMode;
videoResolution: VideoResolution;
pusher: any;
player: any[];
isEarPhone: boolean;
showSelectUser: boolean;
}
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;
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;
}
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,75 @@
import { StoreName } from '../const/index';
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
*/
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;
}
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
export * from './ICallService';
export * from './ICallStore';
export * from './ITUIGlobal';
export * from './ITUIStore';
@@ -0,0 +1,20 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./ICallService"), exports);
__exportStar(require("./ICallStore"), exports);
__exportStar(require("./ITUIGlobal"), exports);
__exportStar(require("./ITUIStore"), exports);