@xylink/xy-rtc-sdk 3.9.1-beta.6 → 3.10.0-beta.4

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.
Files changed (56) hide show
  1. package/lib/action/index.d.ts +103 -20
  2. package/lib/enum/client.d.ts +1 -1
  3. package/lib/enum/{contraints.d.ts → constraints.d.ts} +6 -0
  4. package/lib/enum/device.d.ts +34 -0
  5. package/lib/enum/errorCode.d.ts +7 -1
  6. package/lib/enum/i18n.d.ts +6 -0
  7. package/lib/enum/index.d.ts +70 -12
  8. package/lib/enum/meeting.d.ts +4 -0
  9. package/lib/feature/index.d.ts +1 -0
  10. package/lib/feature/speaker.d.ts +61 -0
  11. package/lib/index.d.ts +13 -10
  12. package/lib/main/ability/const.d.ts +2 -0
  13. package/lib/main/ability/index.d.ts +31 -0
  14. package/lib/main/{iauth.d.ts → auth.d.ts} +8 -8
  15. package/lib/main/client.d.ts +203 -97
  16. package/lib/main/clientImplements.d.ts +99 -0
  17. package/lib/main/deviceManager.d.ts +150 -93
  18. package/lib/main/helper.d.ts +62 -9
  19. package/lib/main/layout/index.d.ts +377 -0
  20. package/lib/main/layout/template.d.ts +64 -0
  21. package/lib/main/meeting.d.ts +32 -26
  22. package/lib/main/peer.d.ts +3 -1
  23. package/lib/main/stream.d.ts +47 -21
  24. package/lib/main/videoManager.d.ts +95 -12
  25. package/lib/tools/{audioLevel.d.ts → analyser.d.ts} +11 -4
  26. package/lib/tools/browser.d.ts +60 -49
  27. package/lib/tools/httpClient.d.ts +27 -6
  28. package/lib/tools/index.d.ts +12 -5
  29. package/lib/tools/{logger.d.ts → log/logger.d.ts} +18 -7
  30. package/lib/tools/log/loggerManager.d.ts +69 -0
  31. package/lib/tools/promiseQueue.d.ts +45 -0
  32. package/lib/tools/queue.d.ts +12 -15
  33. package/lib/tools/resize.d.ts +62 -0
  34. package/lib/tools/snapshot.d.ts +31 -0
  35. package/lib/tools/socket.d.ts +99 -32
  36. package/lib/tools/template/index.d.ts +324 -0
  37. package/lib/tools/template/mobile.d.ts +9 -0
  38. package/lib/tools/utils.d.ts +13 -5
  39. package/lib/type/ability.d.ts +25 -0
  40. package/lib/type/analyser.d.ts +18 -0
  41. package/lib/type/{iauth.d.ts → auth.d.ts} +0 -7
  42. package/lib/type/base.d.ts +16 -0
  43. package/lib/type/client.d.ts +164 -150
  44. package/lib/type/device.d.ts +103 -31
  45. package/lib/type/index.d.ts +3 -1
  46. package/lib/type/layout.d.ts +198 -13
  47. package/lib/type/logger.d.ts +19 -1
  48. package/lib/type/meeting.d.ts +294 -10
  49. package/lib/type/socket.d.ts +60 -0
  50. package/lib/type/stream.d.ts +21 -13
  51. package/lib/xyrtc.cjs.js +1 -1
  52. package/lib/xyrtc.umd.js +1 -1
  53. package/package.json +7 -5
  54. package/lib/main/layoutManager.d.ts +0 -244
  55. package/lib/tools/template.d.ts +0 -21
  56. /package/lib/tools/{logger.worker.d.ts → log/logger.worker.d.ts} +0 -0
@@ -15,57 +15,106 @@ export declare enum PermissionType {
15
15
  'FAILED' = "failed"
16
16
  }
17
17
  /**
18
- * 获取设备信息
18
+ * 设备类型
19
19
  *
20
- * @property { string } deviceId 设备id
21
- * @property { string } label 设备名称
22
- * @property { string } groupId 设备分组
23
- * @property { 'output' | 'input' } direction 设备方向
24
- * @value output 输出设备
25
- * @value input 输入设备
26
- * @property { 'audioinput' | 'audiooutput' | 'videoinput' } kind 设备种类
27
- * @value audioinput 音频输入
28
- * @value audiooutput 音频输出
29
- * @value videoinput 摄像头输入
30
- * @property { string } type 设备采集流类型:video/audio
20
+ * @param AUDIOINPUT audioinput - 麦克风设备
21
+ * @param AUDIOOUTPUT audiooutput - 扬声器设备
22
+ * @param VIDEOINPUT videoinput - 摄像头设备
31
23
  */
32
- export type IDeviceInfo = {
24
+ export declare enum DEVICE_KIND {
25
+ 'AUDIOINPUT' = "audioInput",
26
+ 'AUDIOOUTPUT' = "audioOutput",
27
+ 'VIDEOINPUT' = "videoInput"
28
+ }
29
+ /**
30
+ * 设备基本信息
31
+ *
32
+ * @property { string } deviceId - 设备ID,切换设备时,需要使用此值
33
+ * @property { string } label - 设备名称
34
+ * @property { string } groupId - 设备分组
35
+ * @property { 'audioinput' | 'audiooutput' | 'videoinput' } kind - 设备类型
36
+ */
37
+ export type IDevice = {
33
38
  deviceId: string;
34
39
  label: string;
35
- groupId?: string;
36
- direction?: 'output' | 'input';
37
- kind?: 'audioinput' | 'audiooutput' | 'videoinput';
38
- type?: 'video' | 'audio';
40
+ kind: DEVICE_KIND;
41
+ groupId: string;
39
42
  };
43
+ /**
44
+ * 设备信息
45
+ *
46
+ * @property { boolean } isSelected - 是否选中此设备
47
+ * @property { boolean } isDefault - 是否默认设备
48
+ * @property { string } key - 设备唯一ID
49
+ */
50
+ export interface IDeviceInfo extends IDevice {
51
+ isSelected?: boolean;
52
+ isDefault?: boolean;
53
+ key?: string;
54
+ }
40
55
  /**
41
56
  * 设备列表:麦克风、扬声器、摄像头
42
57
  *
43
- * @property { IDeviceInfo[] } audioInputList 麦克风列表
44
- * @property { IDeviceInfo[] } audioOutputList 扬声器列表
45
- * @property { IDeviceInfo[] } videoInList 摄像头列表
58
+ * @property { IDeviceInfo[] } audioInputList - 麦克风列表
59
+ * @property { IDeviceInfo[] } audioOutputList - 扬声器列表
60
+ * @property { IDeviceInfo[] } videoInList - 摄像头列表
46
61
  */
47
62
  export type IDeviceList = {
48
63
  audioInputList: IDeviceInfo[];
49
64
  audioOutputList: IDeviceInfo[];
50
- videoInList: IDeviceInfo[];
65
+ videoInputList: IDeviceInfo[];
66
+ };
67
+ /**
68
+ * 用户指定设备配置
69
+ *
70
+ * @property { boolean } isDefault - 是否默认设备
71
+ * @property { string } deviceId - 设备ID
72
+ */
73
+ export type ISpecifiedDeviceConfig = {
74
+ isDefault: boolean;
75
+ deviceId: string;
76
+ };
77
+ /**
78
+ * 用户指定设备信息
79
+ *
80
+ * @property { ISpecifiedDeviceConfig } audioInput - 麦克风设备
81
+ * @property { ISpecifiedDeviceConfig } audioOutput - 扬声器设备
82
+ * @property { ISpecifiedDeviceConfig } videoInput - 摄像头设备
83
+ */
84
+ export type ISpecifiedDevice = {
85
+ audioInput: ISpecifiedDeviceConfig;
86
+ audioOutput: ISpecifiedDeviceConfig;
87
+ videoInput: ISpecifiedDeviceConfig;
51
88
  };
52
89
  /**
53
90
  * 当前已选择设备信息
54
91
  *
55
- * @property { IDeviceInfo | undefined } audioInput 麦克风设备
56
- * @property { IDeviceInfo | undefined } audioOutput 扬声器设备
57
- * @property { IDeviceInfo | undefined } videoInput 摄像头设备
92
+ * @property { IDeviceInfo | null } audioInput - 麦克风设备
93
+ * @property { IDeviceInfo | null } audioOutput - 扬声器设备
94
+ * @property { IDeviceInfo | null } videoInput - 摄像头设备
58
95
  */
59
96
  export type ISelectedDevice = {
60
- audioInput: IDeviceInfo | undefined;
61
- videoInput: IDeviceInfo | undefined;
62
- audioOutput: IDeviceInfo | undefined;
97
+ audioInput: IDeviceInfo | null;
98
+ videoInput: IDeviceInfo | null;
99
+ audioOutput: IDeviceInfo | null;
100
+ };
101
+ /**
102
+ * 当前已选择设备信息
103
+ *
104
+ * @property { string } audioInput - 麦克风设备ID
105
+ * @property { string } audioOutput - 扬声器设备ID
106
+ * @property { string } videoInput - 摄像头设备ID
107
+ */
108
+ export type IDeviceId = {
109
+ audioInput: string;
110
+ videoInput: string;
111
+ audioOutput: string;
63
112
  };
64
113
  /**
65
114
  * 设备变化事件
66
115
  *
67
- * @property { ISelectedDevice } nextDevice 最新的设备
68
- * @property { IDeviceList } detail 最新设备详细信息
116
+ * @property { ISelectedDevice } nextDevice - 最新的设备
117
+ * @property { IDeviceList } detail - 最新设备详细信息
69
118
  */
70
119
  export type IDeviceManagerChangeValue = {
71
120
  nextDevice: ISelectedDevice;
@@ -74,10 +123,33 @@ export type IDeviceManagerChangeValue = {
74
123
  /**
75
124
  * 当前麦克风/摄像头权限
76
125
  *
77
- * @property { PermissionType } microphone 麦克风权限
78
- * @property { PermissionType } camera 摄像头权限
126
+ * @property { PermissionType } microphone - 麦克风权限
127
+ * @property { PermissionType } camera - 摄像头权限
79
128
  */
80
129
  export interface ICurrentPermission {
81
130
  microphone: PermissionType;
82
131
  camera: PermissionType;
83
132
  }
133
+ /**
134
+ * 计算默认设备函数参数
135
+ *
136
+ * @property { ISpecifiedDeviceConfig } specifiedDevice - 用户指定的设备信息
137
+ * @property { IDeviceInfo | null } sysDefaultDevice - 系统默认设备信息
138
+ * @property { IDeviceInfo[] } curList - 当前设备列表
139
+ * @property { IDeviceInfo[] } preList - 上一次设备列表
140
+ *
141
+ */
142
+ export interface IDefaultDeviceIdParams {
143
+ specifiedDevice: ISpecifiedDeviceConfig;
144
+ sysDefaultDevice: IDeviceInfo | null;
145
+ curList: IDeviceInfo[];
146
+ preList: IDeviceInfo[];
147
+ }
148
+ /**
149
+ * 指定设备信息
150
+ */
151
+ export interface ISetSpecDevice {
152
+ kind: DEVICE_KIND;
153
+ deviceId: string;
154
+ isDefault: boolean;
155
+ }
@@ -15,4 +15,6 @@ export * from './layout';
15
15
  export * from './quality';
16
16
  export * from './peer';
17
17
  export * from './logger';
18
- export * from './iauth';
18
+ export * from './auth';
19
+ export * from './analyser';
20
+ export * from './ability';
@@ -1,17 +1,5 @@
1
1
  import { ILayout } from './client';
2
- /**
3
- * 模板对应位置类型
4
- *
5
- * @enum
6
- * @param {LOCAL} LOCAL - 本地
7
- * @param {CONTENT} CONTENT - 共享画面
8
- * @param {PEOPLE} PEOPLE - 非共享画面
9
- */
10
- export declare enum TemplateType {
11
- LOCAL = "LOCAL",
12
- CONTENT = "CONTENT",
13
- PEOPLE = "PEOPLE"
14
- }
2
+ import { StreamResolutionLevel, VideoQuality } from './stream';
15
3
  /**
16
4
  * Layout头像类型
17
5
  *
@@ -28,3 +16,200 @@ export declare enum LayoutAvatarType {
28
16
  * Layout map
29
17
  */
30
18
  export type TLayoutMap = Map<string, ILayout>;
19
+ /**
20
+ * 模版类型
21
+ */
22
+ export type IMode = `${TemplateMode | ContentTemplateMode}`;
23
+ /**
24
+ * 【AUTO】模版类型
25
+ *
26
+ * @param SPEAKER - 演讲者模式,即 1大N小 画面模式
27
+ * @param GALLERY - 画廊模式,即 宫格布局
28
+ */
29
+ export declare enum TemplateMode {
30
+ SPEAKER = "SPEAKER",
31
+ GALLERY = "GALLERY"
32
+ }
33
+ /**
34
+ * 【AUTO】Content布局模式
35
+ *
36
+ * @param MULTI_PIC_CONTENT_HIGH_PRIORITY - 缩略视图, Content是大窗口
37
+ * @param MULTI_PIC_ACTIVE_HIGH_PRIORITY - 缩略共享, ActiveSpeaker是大窗口
38
+ * @param TWO_PIC_PIP - 共享视图, 画中画模式(picture in picture)
39
+ * @param CONTENT_ONLY - 共享全视图, 只显示Content
40
+ * @param TWO_PIC_SYMMETRIC - 共享+演讲, 对称显示content和speaker(side by side)
41
+ */
42
+ export declare enum ContentTemplateMode {
43
+ MULTI_PIC_CONTENT_HIGH_PRIORITY = "MULTI_PIC_CONTENT_HIGH_PRIORITY",
44
+ MULTI_PIC_ACTIVE_HIGH_PRIORITY = "MULTI_PIC_ACTIVE_HIGH_PRIORITY",
45
+ TWO_PIC_PIP = "TWO_PIC_PIP",
46
+ CONTENT_ONLY = "CONTENT_ONLY",
47
+ TWO_PIC_SYMMETRIC = "TWO_PIC_SYMMETRIC"
48
+ }
49
+ /**
50
+ * 模板对应位置类型
51
+ *
52
+ * @enum
53
+ * @param LOCAL - 本地
54
+ * @param CONTENT - 共享画面
55
+ * @param PEOPLE - 非共享画面
56
+ * @param CHAIRMAN - 主会场
57
+ */
58
+ export declare enum TemplateType {
59
+ LOCAL = "LOCAL",
60
+ CONTENT = "CONTENT",
61
+ PEOPLE = "PEOPLE",
62
+ CHAIRMAN = "CHAIRMAN",
63
+ NONE = "NONE"
64
+ }
65
+ /**
66
+ * Layout 模版 分辨率
67
+ *
68
+ * @property { StreamResolutionLevel } normal 默认请流分辨率
69
+ * @property { StreamResolutionLevel } low 低性能请流分辨率
70
+ * @property { StreamResolutionLevel } high 高分辨率
71
+ */
72
+ export interface ITemplateResolution {
73
+ normal: StreamResolutionLevel;
74
+ low: StreamResolutionLevel;
75
+ high?: StreamResolutionLevel;
76
+ }
77
+ /**
78
+ * 模版额外配置
79
+ *
80
+ * @property { string } id - templateId (模版名称_画面数量_第几个画面)
81
+ * @property { boolean } isPIP - 是否在画中画
82
+ * @property { boolean } isRotate - 是否要适配旋转
83
+ * @property { number } zIndex - 层级
84
+ * @property { Record<string, string | number> } customStyle - 自定义样式
85
+ */
86
+ export interface ExternalTemplateConfig {
87
+ id?: string;
88
+ isPIP?: boolean;
89
+ isRotate?: boolean;
90
+ zIndex?: number;
91
+ customStyle?: Record<string, string | number>;
92
+ }
93
+ /**
94
+ * Layout模版定义
95
+ *
96
+ * @property { number[] } position - 位置/尺寸比例
97
+ * @property { ITemplateResolution } resolution - 分辨率
98
+ * @property { number } resolution.normal - 正常分辨率
99
+ * @property { number } resolution.low - 低性能模式分辨率
100
+ * @property { number } resolution.high - 高分辨率
101
+ * @property { VideoQuality } quality - 请流质量
102
+ * @property { TemplateType } type - 类型,LOCAL/CONTENT/PEOPLE/CHAIRMAN
103
+ * @property { any } config - 额外配置项 eg: zIndex - 层级
104
+ * @property { string } calluri - 指定请流的callUri
105
+ */
106
+ export type ITemplateObj = {
107
+ position: number[];
108
+ resolution: ITemplateResolution;
109
+ quality?: VideoQuality;
110
+ type?: TemplateType;
111
+ config?: ExternalTemplateConfig;
112
+ calluri?: string;
113
+ };
114
+ /**
115
+ * 模版信息
116
+ */
117
+ export type ITemplate = Partial<{
118
+ [type in TemplateMode | ContentTemplateMode]: TemplateInfos;
119
+ }>;
120
+ export interface TemplateInfos {
121
+ temp: {
122
+ [id: string]: ITemplateObj[];
123
+ };
124
+ rate: {
125
+ [index: number]: number;
126
+ };
127
+ }
128
+ /**
129
+ * 最终匹配的模版数据
130
+ *
131
+ * @param { ITemplateObj[] } template 模版信息
132
+ * @param { number } rate 容器比例
133
+ */
134
+ export interface TemplateInfo {
135
+ template: ITemplateObj[];
136
+ rate: number;
137
+ }
138
+ /**
139
+ * 获取模版配置参数
140
+ *
141
+ * @param { TemplateMode | ContentTemplateMode } modeType - 模版类型
142
+ * @param { number } currentCount - 画面数量
143
+ * @param { number } participantCount - 会中总人数
144
+ * @param { boolean } isLocalHide - 是否隐藏本地画面
145
+ * @param { boolean } isChairmanMode - 是否是主会场模式
146
+ * @param { TemplateType } templateType - 全屏画面类型
147
+ * @param { LayoutOrientationType } orientation - 是否是移动端,及方向
148
+ * @param { FocusViewConfig } focusViewConfig - 切换的主画面信息
149
+ */
150
+ export interface TemplateParams {
151
+ modeType?: TemplateMode | ContentTemplateMode;
152
+ currentCount?: number;
153
+ participantCount?: number;
154
+ isLocalHide?: boolean;
155
+ isChairmanMode?: boolean;
156
+ templateType?: TemplateType;
157
+ orientation?: LayoutOrientationType;
158
+ focusViewConfig?: FocusViewConfig;
159
+ }
160
+ /**
161
+ * Layout 移动端布局方向
162
+ *
163
+ * @param NONE -1 - 默认布局(PC)
164
+ * @param MOBILE_HORIZONTAL 0 - 移动端横屏布局
165
+ * @param MOBILE_VERTICAL 1 - 移动端竖屏布局
166
+ */
167
+ export declare enum LayoutOrientationType {
168
+ NONE = -1,
169
+ MOBILE_HORIZONTAL = 0,
170
+ MOBILE_VERTICAL = 1
171
+ }
172
+ /**
173
+ * 指定的主画面的信息
174
+ *
175
+ * @property { string } id - 指定的主画面的LayoutId
176
+ * @property { TemplateType } type - 画面类型
177
+ */
178
+ export interface FocusViewConfig {
179
+ id: string;
180
+ type: TemplateType;
181
+ }
182
+ /**
183
+ * RosterId 分割信息
184
+ *
185
+ * @property { string } endpointId - 参会者callUri字段
186
+ * @property { string } mediagroupId - 多分组ID
187
+ */
188
+ export interface IRosterIdInfo {
189
+ endpointId: string;
190
+ mediagroupId: string;
191
+ }
192
+ /**
193
+ * 计算Video元素旋转样式
194
+ *
195
+ * @property { string } transform - Video元素选转角度:rotateZ(${n}deg)
196
+ * @property { string } width - Video元素的宽:${n}px
197
+ * @property { string } height - Video元素的高:${n}px
198
+ */
199
+ export interface IRotateStyle {
200
+ transform?: string;
201
+ width?: string;
202
+ height?: string;
203
+ }
204
+ /**
205
+ * 需要管理员广播才能收看内容共享
206
+ *
207
+ * @property { boolean } enableContentLiveOnHold - 是否开启了指定内容广播
208
+ * @property { string } audioTrackId - 广播的audioTrackId
209
+ * @property { string } contentUrl - 广播的contentUrl
210
+ */
211
+ export interface ContentOnholdInfo {
212
+ enableContentLiveOnHold: boolean;
213
+ audioTrackId: string;
214
+ contentUrl: string;
215
+ }
@@ -20,13 +20,15 @@ export declare enum MessageKind {
20
20
  * @param DESTROY - 销毁操作
21
21
  * @param DOWNLOAD - 下载日志操作
22
22
  * @param UPLOAD - 上传日志操作
23
+ * @param GET_DATA - 获取日志数据
23
24
  */
24
25
  export declare enum LogOperateType {
25
26
  LOGGER = "LOGGER",
26
27
  INIT = "INIT",
27
28
  DESTROY = "DESTROY",
28
29
  DOWNLOAD = "DOWNLOAD",
29
- UPLOAD = "UPLOAD"
30
+ UPLOAD = "UPLOAD",
31
+ GET_DATA = "GET_DATA"
30
32
  }
31
33
  /**
32
34
  * 日志等级
@@ -67,6 +69,7 @@ export type TLogLevel = `${LogLevel}`;
67
69
  * @param { string[] } deleteDBNames - 需要删除的历史数据库名,默认值[]
68
70
  * @param { boolean } isUpdateVersion - 是否需要更新表版本(历史表都将被删除,避免错误)
69
71
  * @param { number } detectTimer - 多久检测一次表的最大长度,单位ms,默认值:300000(5分钟)
72
+ * @param { string } scope - 配置日志Scope范围,例如配置为'APP',则所有日志显示为:[16:14:24 490][INFO][APP]xxxx
70
73
  */
71
74
  export interface ILoggerConfig {
72
75
  dbName: string;
@@ -80,6 +83,7 @@ export interface ILoggerConfig {
80
83
  deleteDBNames?: string[];
81
84
  isUpdateVersion?: boolean;
82
85
  enableClearTable?: boolean;
86
+ scope?: string;
83
87
  }
84
88
  /**
85
89
  * 数据库操作配置
@@ -110,3 +114,17 @@ export interface IWorkerData {
110
114
  [key: string]: any;
111
115
  } & ILoggerConfig;
112
116
  }
117
+ /**
118
+ * 日志上传参数
119
+ *
120
+ * @param { string } name - 上传文件名
121
+ * @param { string } account - 上传账号
122
+ * @param { string } comments - 上传时备注信息
123
+ * @param { string } dbName - 日志库名称,默认不传,上传所有日志
124
+ */
125
+ export interface UploadLogParams {
126
+ name?: string;
127
+ account?: string;
128
+ comments?: string;
129
+ dbName?: string;
130
+ }