/** * xylink electron sdk types files * * @authors Luo-jinghui (luojinghui424@gmail.com) * @date 2020-07-10 15:44:10 */ import { Render } from '../render/index'; import { ContentCaptureType, ContentStreamMode, EventType, Locale, ProcessType, RecordStatus, TemplateModel, TempValType, TerminalType, VideoState } from './enum.type'; export declare type IModel = 'AUTO' | 'CUSTOM' | 'auto' | 'custom'; export declare type IAudio = 'unmute' | 'mute'; export declare type IVideo = 'unmuteVideo' | 'muteVideo'; export declare type IHowlingDetected = 0 | 1; export declare type IMicMuted = 0 | 1; export declare type TQuality = 0 | 1 | 2; export declare type TResolution = 0 | 1 | 2 | 3 | 4; export declare type TCallMode = 'AudioVideo' | 'AudioOnly'; export declare type TFaceType = 'Detect' | 'EletronicBadge'; /** * 呼叫会议状态 * */ export declare type TCallState = 'Not_In_Call' | 'Connected' | 'Disconnected' | 'Connecting' | 'Disconnecting'; export declare enum SDKVideoResolution { VideoResolution90P = 0, VideoResolution180P = 1, VideoResolution360P = 2, VideoResolution720P = 3, VideoResolution1080P = 4, VideoResolution4K = 5, VideoResolutionUnknown = 6 } /** * 获取videoFrame定时器间隔 */ export declare enum RendererTimer { LOW = 66.66, HD = 33.33 } /** * 内容共享状态 */ export declare enum ShareContentState { IDLE = 0, SENDING = 1, RECEIVING = 2, NO_BAND_WIDTH = 3, ERROR = 4, EXCEED_MAX_SHARE_CONTENT_COUNT = 5 } export interface IConfig { clientId: string; clientSecret: string; offset?: [number, number]; httpProxy?: string; model?: IModel; muteAudio?: boolean; muteVideo?: boolean; templateModel?: TemplateModel; isMonitor?: boolean; logPath?: string; dllPath?: string; path?: string; sdkDllPath?: string; sdkProjectPath?: string; container?: { elementId?: string; offset?: number[]; }; autoResizeLayout?: boolean; appType?: string; enableSharingIndicator?: boolean; hostAddress?: string; port?: number; } /** * 参会者基本信息,包含基本信息/设备信息/画面信息等 * * @property { string } displayName 参会者名称 * @property { boolean } isContent 参会者画面类型,true: 是共享内容画面,false: people 画面 * @property { number } state 当前参会者的画面状态信息 1:视频关闭; 2:视频请求中; 3:网络带宽不够,无法接受视频; 4:无解码数据; 5:正常接收画面; 6:手机或PSTN入会; 7:仅语音入会 * @property { boolean } audioMute 音频状态 true:静音, false: 非静音 * @property { string } callUri 终端id * @property { boolean } isActiveSpeaker 参会者是否是语音激励,即当前会中说话声音最大的一个人 * @property { string } exDeviceId 屏幕设备Id * @property { number } videoWidth 视频宽度 * @property { number } videoHeight 视频高度 * */ export interface IRoster { displayName: string; isContent: boolean; state: VideoState; sourceId: string; audioMute: boolean; callUri: string; isActiveSpeaker: boolean; exDeviceId?: string; videoWidth?: number; videoHeight?: number; feccOri?: number; dt: TerminalType; } declare type IPosition = { width: number; height: number; }; declare type IPositionStyl = { left: string; top: string; width: string; height: string; }; /** * Layout 基础数据 * * @property { string } id callUri + (isContent ? "1" : "0") * @property { string } sourceId 视频sourceId,本地预览的sourceId 固定为:LocalPreviewID * @property { IRoster } roster 参会者基本信息/状态信息 * @property { IPosition } position 当前参会者layout位置信息 * @property { IPositionStyl } positionStyle 当前参会者的位置样式 */ export interface ILayout { id: string; sourceId: string; roster: IRoster; position: IPosition; positionStyle: IPositionStyl; ipcKey?: string; isLocal?: boolean; } /** * 会议室信息 * * @property { string } meetingId 呼叫的会议号 * @property { string } displayName 会中显示的名称 * @property { string } meetingPwd 会议密码 * @property { string } vcNumber 真实的会议号 * @property { string } numberType 会议类型 * @property { string } meetingName 会议室名称 */ export declare type IMakeCallInfo = { meetingNumber: string; displayName: string; meetingPwd: string; vcNumber?: string; numberType?: string; meetingName?: string; meetingId?: string; }; declare type ITempVal = { position: number[]; resolution: number; type?: TempValType; zIndex?: number; }; export interface ITemplateObj { length: number; temp: { [prop: number]: ITempVal[]; }; rate: { [prop: number]: number; }; } export declare type ITemplate = { [index in TemplateModel]: ITemplateObj; }; export declare type ITypeTemplate = { [index: string]: ITempVal[]; }; /** * 自动布局模式下,Layout Container的容器信息 * 计算得到的宽高能给铺满当前参会者的布局 * * @property { number } width 减掉偏移左右值的container容器宽 * @property { number } height 减掉偏移左右值的container容器高 * @property { number } layoutWidth 基于Width配合Layout Rate计算得到的layout container容器宽 * @property { number } layoutHeight 基于Height配合Layout Rate计算得到的layout container容器高 */ export interface IScreenInfo { width?: number; height?: number; layoutWidth?: number; layoutHeight?: number; } export interface ITempScreenInfo { width: number; height: number; isWidth: boolean; rateWidth: number; rateHeight: number; } export declare type ITempLayout = ITempVal[]; export interface ILoginInfo { callUri: string; displayName: string; userId: number; deviceId: number; } /** * 登录状态信息 * * @property { string } state 登录状态 Logined | Logining | logouting | Logouted * @property { string } error 错误码 * @property { ILoginInfo } info 用户信息 */ export declare type ILoginState = { state: string; error: string; info?: ILoginInfo; }; /** * 呼叫及会议室相关信息 * * @property { number } state * @property { number } error * @property { string } reason */ export interface ICallStateChanged extends IConferenceInfo, IOnHoldInfo { state: number; error: number; reason: string; } /** * 呼叫及会议室相关信息 * * @property { string } state * @property { string } error * @property { string } reason * @property { string } code */ export interface ICallState { state: string; error: string; reason: string; code: string; } /** * 云会议室相关信息 * * @property { string? } meetingNumber 云会议室号码 * @property { string? } numberType 云会议室类型 * @property { string? } displayName 云会议室名称 */ export interface IConferenceInfo { meetingNumber?: string; numberType?: string; displayName?: string; } /** * 等候室相关信息 * * @property { boolean? } isOnhold 是否是等候室 * @property { number? } onHoldCount 等候人数 * @property { string? } waitingReason 原因 */ export interface IOnHoldInfo { isOnhold?: boolean; onHoldCount?: number; waitingReason?: string; } export declare type IRenderer = { [sourceId: string]: { render: Render | null; ele: any; }; }; export declare type IRendererObj = { [sourceId: string]: { render: Render | null; isContent: boolean; timer: any; }; }; export interface IVideoFrame { hasData: boolean; sourceId: string; buffer: any; width: number; height: number; rotation: number; } export declare type IConfInfo = { contentPartCount: number; participantCount: number; chairManUrl: string; visibleEpCount: number; }; export interface IConfControl { chirmanUri: string; confMgmtUrl: string; muteSpk: string; muteMic: string; commonJson: string; disableMute: boolean; disableRecord: boolean; disableContent: boolean; feccIsDisabled: boolean; disableWhiteboard: boolean; disableAnnotation: boolean; } export interface IDeviceItem { devId: string; devName: string; isSelected: boolean; } export interface IDeviceList { camera: IDeviceItem[]; microphone: IDeviceItem[]; speaker: IDeviceItem[]; } export interface ICurrentDevice { camera: string; microphone: string; speaker: string; } export interface IVideoProfile { maxResPvtx: number; maxResPvrx: number; maxFpsPvtx: number; maxFpsPvrx: number; } /** * 共享缩略图数据 * * @property {boolean} hasData 是否有 buffer 数据 * @property {number} width 缩略图宽度 * @property {number} height 缩略图高度 * @property {Uint8Array} buffer 缩略图 argb 数据 */ export interface IContentThumbnail { hasData: boolean; width: number; height: number; buffer: Uint8Array; } /** * 显示器缩略图 * * @property {string} monitorName 显示器唯一标识 */ export interface IMonitorThumbnail extends IContentThumbnail { monitorName: string; } /** * App 缩略图 * * @property {number} hwnd app 窗口句柄 */ export interface IAppThumbnail extends IContentThumbnail { hwnd: number; } /** * App icon */ export declare type IAppIcon = IAppThumbnail; /** * App 应用信息 * * @property {number} appId appId * @property {string} appName app 名称 * @property {number} hwnd app 窗口句柄 */ export interface IApp { appId: number; appName: string; hwnd: number; } export interface IAudioMeterInfo { callUri: string; energy: number; pid: number; } interface IAudioStatistics { codecType: string; displayName: string; actBw: number; } interface IVideoStatistics { codecType: string; displayName: string; actBw: number; frameRate: number; resolution: string; } interface IAVSessionStatistics { audioRxInfo: IAudioStatistics[]; audioTxInfo: IAudioStatistics[]; videoRxInfo: IVideoStatistics[]; videoTxInfo: IVideoStatistics[]; } interface INetworkStatistics { rtt: number; rxDetectBw: number; rxJitter: number; rxLost: number; txDetectBw: number; txJitter: number; txLost: number; } /** * 呼叫统计信息 * * @property { IAVSessionStatistics } people 与会人媒体统计信息 * @property { IAVSessionStatistics } content 共享内容媒体统计信息 * @property { INetworkStatistics } network 网络状况统计 * @property { string } encrypt 会议室加密方式 */ export interface IStatistics { people: IAVSessionStatistics; content: IAVSessionStatistics; network: INetworkStatistics; encrypt: string; } export interface ICallInvited { invited: boolean; callMode: number; remoteUri: string; remoteName: string; remoteNumber: string; remoteAlias: string; remoteType: string; } export interface ISubTitle { action: string; content: string; location: string; fontSize: string; backgroundAlpha: string; backgroundRGB: string; fontRGB: string; scrollSpeed: string; fontFamily: string; scroll: boolean; } export interface IInOutReminder { displayName: string; action: string; extUserId: string; } /** * 请流Req对象属性值 * * @property isContent 是否是共享内容 * @property callUri 用户唯一id * @property resolution 请求分辨率值 * @property quality 请求画面质量 */ export interface IReqObj { isContent: boolean; callUri: string; resolution: TResolution; quality: TQuality; } /** * 请流参数 * * @property pageIndex 请求页数 * @property maxViewCountPerPage 每页最大数量 * @property reqList 指定每个参会者的分辨率、id、质量、是否是共享内容值 */ export interface IReqParams { pageIndex: number; maxViewCountPerPage: number; reqList: IReqObj[]; } export interface ILocalVideoStatus { audio: IAudio; video: IVideo; rename: string; } export interface IMaster { serial: string; authTimeout: number; localIP: string; deviceID: string; keepAliveTimeout: number; keepAliveInterval: number; name: string; readInterval: number; maxDataLength: number; serverPort: number; serverIP: string; moduleType: number; connType: number; } export interface IMasterParams { deviceID: string; } export interface IMasterMap { [key: string]: IMaster; } /** * 人脸位置信息 * * @property { number } faceId 人脸的ID * @property { number } left 检测人脸的左侧距离 * @property { number } right 检测人脸的右侧距离 * @property { number } top 检测人脸的顶部距离 * @property { number } bottom 检测人脸的底部距离 * */ export interface IFacePosition { faceId: number; left: number; right: number; top: number; bottom: number; } /** * 人脸信息 * * @property { boolean } isLocal 是否是自己 * @property { string } calluri 设备id * @property { string } participantId 参会者id * @property { number } type 0:人脸识别 1:人脸跟踪 2:电子铭牌 * @property { number } seq * @property { IFacePosition[] } positionArr 人脸位置信息 */ export interface IAIFaceRecv { isLocal: boolean; calluri: string; participantId: number; type: number; seq: number; faceInfoArr: IAIFaceInfo[]; } /** * 人脸对应信息 * * @property { string } userId 人脸对应用户ID * @property { string } userName 用户名称 * @property { string } userNickName * @property { number } userAge 用户年龄 * @property { string } userIdentifyCard * @property { string } userTitle 用户企业名称 * @property { string } userPhone 用户手机号 * @property { number } userStatus */ export interface IAIFaceInfo { userId: string; userName: string; userNickName: string; userAge: number; userIdentifyCard: string; userTitle: string; userPhone: string; userStatus: number; position: IFacePosition; } export interface IRequest { what: number; method: 'GET' | 'POST' | 'PUT' | 'DELETE'; requestUrl: string; requestBody?: string; } export interface IResponse { what: number; response: string; } export interface IRestApiResult { code: number; body: string; } /** * 会控主持人回调 * * @property {string} isHost 是否为主持人 */ export interface IConfHost { isHost: boolean; } export interface IRecordStateChange { recordState: RecordStatus; error: number; reason: string; } /** * 录制权限 * * @property { boolean } isStartRecord 是否其他人已经开启录制 * @property { boolean } canRecord 录制开关 * @property { boolean } confCanRecord 会控控制录制权限开关 */ export interface IRecordPermission { isStartRecord: boolean; canRecord: boolean; confCanRecord: boolean; } /** * 本地麦克风状态,当会议状态或者操作影响到麦克风状态时,会推送此事件上层更新麦克风状态 * * @property { IAudio } muteMic */ export interface IAudioStatus { muteMic: IAudio; } /** * 自动布局分页详细 */ export interface IPageInfo { currentPage: number; maxSize: number; totalPage: number; } /** * 会控开启关闭摄像头 * * @property {boolean} isMuteCamera 是否关闭摄像头 * @property {boolean} isForceUnmuteCamera 是否强制打开摄像头 目前不支持 忽略 */ export interface IMeetingMuteQuery { isMuteCamera: boolean; isForceUnmuteCamera: boolean; } /** * 互动工具业务涉及到弹窗和状态栏内容 * * @property {string} notifyContent - 左上角状态栏文案 * @property {string} notifyLabel - 左上角状态栏按钮内容 比如签到按钮 * @property {string} dialogTitle - 弹窗标题 * @property {string} dialogContent - 弹窗主要内容 黑体字部分 * @property {string} dialogSubContent - 弹窗描述 * @property {string} dialogLabel - 弹窗右下角按钮文案 */ export interface ICopywriting { notifyContent: string; notifyLabel: string; dialogTitle: string; dialogContent: string; dialogSubContent: string; dialogLabel: string; } /** * 会控互动工具相关数据,兼容签到、答题、投票等 * * @property {ICopywriting} copywriting - 弹窗内容、左侧顶部状态栏内容 * @property {EventType} eventType - 互动事件 start end publish RESULT_CLOSE * @property {ProcessType} processType - 互动工具业务类型:签到 答题 投票 评价 * @property {string} questionnaireId - 业务id * @property {boolean} endAuto - 是否自动结束(有倒计时),还是手动结束 * @property {number} duration - 期限,比如签到剩余时间 * @property {string} webViewUrl - h5页面url * @property {number} endUtcTime - 结束时间 */ export interface IInteractiveToolInfo { isSupport?: boolean; eventType: EventType; processType: ProcessType; endAuto: boolean; duration: number; endUtcTime: number; webViewUrl: string; resultWebViewUrl?: string; questionnaireId: string; meetingId: string; business: string; copywriting: ICopywriting; } /** * TODO 签到结果 * * @property {number} code - 签到结果 0 成功 其它 失败 * @property {string} status - 待提供 */ export interface ISignInfo { code: string | number; status: string; } /** * 同传字幕内容 * * @property { number } pid 当前说话的终端 * @property { string } src 原文 * @property { string } target 译文 * @property { number } seTime 发送时间 * @property { number } startTime 开始时间 * @property { number } endTime 结束时间 * @property { boolean } isEnd 一句话是否结束 * @property { boolean } isActive 活跃标志,收三路,同时只有一路active * @property { string } url 终端calluri * @property { string } dn 显示名称 * @property { string } meetingId 会议号 * @property { string } srcLang 原语言,zh表示中文,en表示英文 * @property { string } targetLang 译文语言,zh表示中文,en表示英文 */ export interface IAiCaptionInfo { src: string; target: string; srcLang: string; targetLang: string; dn: string; url: string; meetingId: string; isEnd: boolean; isActive: boolean; seTime: number; endTime: number; startTime: number; pid: number; } /** * App共享采集状态 * * @property {boolean} isClosed 应用是否被关闭 * @property {boolean} isOccluded 应用是否被遮挡 * @property {boolean} isPaused 应用采集是否已暂停,应用最小化或者被遮挡可能会自动暂停 */ export interface IAppWindowCaptureState { isClosed: boolean; isOccluded: boolean; isPaused: boolean; } /** * YUV Frame原始画面数据 * * @property { boolean } hasData - 是否存在YUV数据 * @property { ArrayBuffer } buffer - YUV 420 Buffer数据 * @property { number } width - 画面宽度 * @property { number } height - 画面高度 * @property { number } sarWidth - 画面除去黑边宽度 * @property { number } sarHeight - 画面除去黑边高度 * @property { number } rotation - 画面旋转方向 */ export interface IFrame { hasData: boolean; buffer: ArrayBuffer; width: number; height: number; sarWidth: number; sarHeight: number; rotation: number; } /** * 新的三方登录-小鱼账户 * * @property {string} extID 企业id * @property {string} countryCode 国家代码 * @property {string} account 账号 * @property {string} password 密码 */ export interface IXYParams { extID: string; countryCode?: string; account: string; password: string; } /** * 新的三方登录-token登录方式 * * @property {string} extID 企业id * @property {string} token token信息 */ export interface IExtTokenParams { extID: string; token: string; } /** * 新的三方登录-企业用户ID登录 * * @property {string} extID 企业id * @property {string} displayName 用户名称 * @property {string} extUID 用户ID * @property {string} authCode 授权码 */ export interface IExtUserIdParams { extID: string; displayName: string; extUID: string; authCode: string; isTempUser?: boolean; } /** * 错误码结构 */ export declare type TErrorMap = { [key in Locale]: { [key: string]: string; }; } & { version?: string; }; /** * 区域坐标范围 * * @property {number} x the X-coordinate of the top-left point of region * @property {number} y the Y-coordinate of the top-left point of region * @property {number} w width of region * @property {number} h height of region */ export interface IRegion { x: number; y: number; w: number; h: number; } /** * 采集content配置 * * @property {string} source content唯一标识 对于屏幕共享是monitorName(区域共享无需传monitorName), 对于网络资源和媒体文件共享是url,对于本地摄像头共享是deviceId, 其它情况是空 * @property {number} viewId window句柄,适用App共享, 其它情况是0 * @property {boolean} withAudio 是否共享屏幕声音 适用于屏幕共享和App共享 * @property {IRegion} region 区域范围 适用于屏幕共享中选择部分区域共享 * @property {boolean} localContentPreview 本地content预览 适用于屏幕共享 * @property {boolean} enableFluentMode 是否开启流畅模式,资源消耗较低 * @property {boolean} bEnableAnnotation 允许远端批注 */ export interface IContentInfo { source: string; viewId?: number; withAudio?: boolean; region?: IRegion; localContentPreview?: boolean; enableFluentMode?: boolean; bEnableAnnotation?: boolean; } /** * 开始共享参数 * * @property {ContentStreamMode} contentStreamMode content流模式 * @property {ContentCaptureType} contentCaptureType content采集类型 * @property {IContentInfo} contentInfo content配置 */ export interface ISendContentParams { contentStreamMode: ContentStreamMode; contentCaptureType: ContentCaptureType; contentInfo: IContentInfo; } /** * Electron sdk version * * @property {string} version Electron sdk 版本号 * @property {string} buildTime Electron sdk 构建时间 * @property {string} cppVersion 依赖c++ sdk 版本号 * @property {string} info Electron sdk 构建详情 */ export interface IVersion { version: string; buildTime: string; cppVersion: string; info: string; } /** * 显示器详情,包含位置信息 */ export interface IMonitorInfo { monitorName: string; rect: IRegion; } /** * 点 */ export interface IPoint { x: number; y: number; } /** * 标注线 发送 * * @property {number} weight 宽度 * @property {string} color 颜色 Like "#121212ff" RGBA * @property {string} calluri 表示发给谁, * @property {string} uuid 线uuid, 发送者(content接受者)发送后,会回调uuid * @property {boolean} ended 是否线结束, 默认true * @property {boolean} getAllLines 默认false * @property {IPoint[]} points 点数组 */ export interface ILine { weight: number; color: string; calluri?: string; uuid?: string; ended?: boolean; getAllLines?: boolean; points: IPoint[]; } /** * 接收发送的线 * * @property {number} sequece 线的序列号 * @property {number} weight 宽度 * @property {string} color 颜色 Like "#121212ff" RGBA * @property {string} sourceCallUri 线目标发送设备calluri * @property {string} targetCallUri 线的原始发出设备calluri * @property {string} uuid 线uuid, 发送者(content接受者)发送后,会回调uuid * @property {boolean} ended 是否线结束, 默认true * @property {IPoint[]} points 点数组 */ export interface IReceiveLine { sequece: number; weight: number; color: string; sourceCallUri: string; targetCallUri: string; uuid: string; points: IPoint[]; ended: boolean; } /** * 代理设置详情 * * @property {string} hostAddress host 域名 * @property {number} port 端口 * @property {string} username 账号 only for SOCKS5 authentication * @property {string} password 密码 only for SOCKS5 authentication */ export interface XYProxyInfo { hostAddress?: string; port?: number; username?: string; password?: string; } /** * 状态码数据 * * @property { string } code 状态码 * @property { Record } data 数据 * @property { string } msg 消息描述 */ export interface XYReturnResult { code: string; msg: string; data: Record; } export {};