@xylink/xy-rtc-sdk 2.1.2 → 3.8.0-beta.1
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/README.MD +37 -37
- package/lib/{src/action → action}/index.d.ts +237 -236
- package/lib/{src/enum → enum}/contraints.d.ts +116 -116
- package/lib/{src/enum → enum}/errorCode.d.ts +880 -880
- package/lib/{src/enum → enum}/index.d.ts +137 -133
- package/lib/{src/index.d.ts → index.d.ts} +34 -34
- package/lib/{src/main → main}/client.d.ts +878 -808
- package/lib/{src/main → main}/deviceManager.d.ts +164 -164
- package/lib/{src/main → main}/helper.d.ts +51 -51
- package/lib/{src/main → main}/iauth.d.ts +33 -33
- package/lib/{src/main → main}/layoutManager.d.ts +214 -214
- package/lib/{src/main → main}/peer.d.ts +311 -311
- package/lib/{src/main → main}/qualityManager.d.ts +39 -39
- package/lib/{src/main → main}/stream.d.ts +263 -243
- package/lib/{src/main → main}/videoManager.d.ts +65 -65
- package/lib/{src/tools → tools}/audioLevel.d.ts +23 -23
- package/lib/{src/tools → tools}/browser.d.ts +55 -55
- package/lib/{src/tools → tools}/config.d.ts +12 -12
- package/lib/{src/tools → tools}/db.d.ts +85 -85
- package/lib/{src/tools → tools}/detect.d.ts +44 -45
- package/lib/{src/tools → tools}/emmitter.d.ts +15 -15
- package/lib/{src/tools → tools}/enum.d.ts +6 -6
- package/lib/{src/tools → tools}/httpClient.d.ts +64 -64
- package/lib/{src/tools → tools}/i18n.d.ts +8 -8
- package/lib/{src/tools → tools}/index.d.ts +8 -8
- package/lib/{src/tools → tools}/logger.d.ts +151 -151
- package/lib/{src/tools → tools}/socket.d.ts +53 -53
- package/lib/{src/tools → tools}/store.d.ts +15 -15
- package/lib/{src/tools → tools}/template.d.ts +14 -14
- package/lib/{src/tools → tools}/utils.d.ts +73 -67
- package/lib/{src/tools → tools}/verify.d.ts +7 -7
- package/lib/{src/type → type}/base.d.ts +71 -71
- package/lib/{src/type → type}/client.d.ts +1121 -1106
- package/lib/{src/type → type}/device.d.ts +77 -77
- package/lib/{src/type → type}/index.d.ts +11 -11
- package/lib/{src/type → type}/quality.d.ts +77 -77
- package/lib/{src/type → type}/stream.d.ts +426 -426
- package/lib/xyrtc.cjs.js +1 -0
- package/lib/xyrtc.umd.js +1 -0
- package/package.json +119 -130
- package/scripts/build_lib.js +16 -0
- package/scripts/utils.js +27 -0
- package/scripts/webpack.common.js +139 -0
- package/scripts/webpack.dev.js +27 -0
- package/scripts/webpack.sdk.js +68 -0
- package/tsconfig.lib.json +37 -0
- package/lib/index.es.js +0 -3
- package/lib/index.js +0 -3
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* webrtc axios request lib
|
|
3
|
-
*
|
|
4
|
-
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
|
-
* @date 2019-11-01 14:14:45
|
|
6
|
-
*/
|
|
7
|
-
import { AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
8
|
-
import Logger from '../tools/logger';
|
|
9
|
-
import { IToken, ISignParams } from '../type';
|
|
10
|
-
export interface IResponseSuccess {
|
|
11
|
-
code: number;
|
|
12
|
-
data: any;
|
|
13
|
-
}
|
|
14
|
-
export interface IResponseFailed {
|
|
15
|
-
code: number;
|
|
16
|
-
data: any;
|
|
17
|
-
}
|
|
18
|
-
export interface IAxiosRequestConfig extends AxiosRequestConfig {
|
|
19
|
-
sign?: 0 | 1;
|
|
20
|
-
clientSecret?: string;
|
|
21
|
-
clientId?: string;
|
|
22
|
-
}
|
|
23
|
-
declare class HttpClient {
|
|
24
|
-
commonOption: AxiosRequestConfig;
|
|
25
|
-
axios: AxiosInstance;
|
|
26
|
-
loginInfo: any;
|
|
27
|
-
logger: Logger | null;
|
|
28
|
-
private baseUrl;
|
|
29
|
-
private clientId;
|
|
30
|
-
private clientSecret;
|
|
31
|
-
private retryCount;
|
|
32
|
-
constructor(commonOption: IAxiosRequestConfig);
|
|
33
|
-
refreshToken({ baseURL, refresh_token }: {
|
|
34
|
-
baseURL?: string | undefined;
|
|
35
|
-
refresh_token?: string | undefined;
|
|
36
|
-
}): Promise<any>;
|
|
37
|
-
setLogger(logger: Logger): void;
|
|
38
|
-
setBaseUrl(url: string): void;
|
|
39
|
-
setClientInfo({ clientId, clientSecret }: {
|
|
40
|
-
clientId: string;
|
|
41
|
-
clientSecret: string;
|
|
42
|
-
}): void;
|
|
43
|
-
setHttpConfig(config: IAxiosRequestConfig): void;
|
|
44
|
-
getApiHeader(params: ISignParams): {
|
|
45
|
-
Authorization?: string | undefined;
|
|
46
|
-
'x-xy-clientid': string;
|
|
47
|
-
'x-xy-clienttype': string;
|
|
48
|
-
'x-xy-nonce': number;
|
|
49
|
-
'x-xy-timestamp': number;
|
|
50
|
-
'x-xy-signtype': string;
|
|
51
|
-
'x-xy-sign': string;
|
|
52
|
-
'x-xy-signatureversion': string;
|
|
53
|
-
};
|
|
54
|
-
setLoginInfo(loginInfo: IToken | null): void;
|
|
55
|
-
getLoginInfo(): any;
|
|
56
|
-
assignOptions: (option?: AxiosRequestConfig) => AxiosRequestConfig & {
|
|
57
|
-
params: any;
|
|
58
|
-
};
|
|
59
|
-
get: (url: string, option?: IAxiosRequestConfig) => any;
|
|
60
|
-
put: (url: string, data?: any, option?: AxiosRequestConfig) => any;
|
|
61
|
-
post: (url: string, data?: any, option?: AxiosRequestConfig) => any;
|
|
62
|
-
delete: (url: string, option?: AxiosRequestConfig) => any;
|
|
63
|
-
}
|
|
64
|
-
export default HttpClient;
|
|
1
|
+
/**
|
|
2
|
+
* webrtc axios request lib
|
|
3
|
+
*
|
|
4
|
+
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
|
+
* @date 2019-11-01 14:14:45
|
|
6
|
+
*/
|
|
7
|
+
import { AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
8
|
+
import Logger from '../tools/logger';
|
|
9
|
+
import { IToken, ISignParams } from '../type';
|
|
10
|
+
export interface IResponseSuccess {
|
|
11
|
+
code: number;
|
|
12
|
+
data: any;
|
|
13
|
+
}
|
|
14
|
+
export interface IResponseFailed {
|
|
15
|
+
code: number;
|
|
16
|
+
data: any;
|
|
17
|
+
}
|
|
18
|
+
export interface IAxiosRequestConfig extends AxiosRequestConfig {
|
|
19
|
+
sign?: 0 | 1;
|
|
20
|
+
clientSecret?: string;
|
|
21
|
+
clientId?: string;
|
|
22
|
+
}
|
|
23
|
+
declare class HttpClient {
|
|
24
|
+
commonOption: AxiosRequestConfig;
|
|
25
|
+
axios: AxiosInstance;
|
|
26
|
+
loginInfo: any;
|
|
27
|
+
logger: Logger | null;
|
|
28
|
+
private baseUrl;
|
|
29
|
+
private clientId;
|
|
30
|
+
private clientSecret;
|
|
31
|
+
private retryCount;
|
|
32
|
+
constructor(commonOption: IAxiosRequestConfig);
|
|
33
|
+
refreshToken({ baseURL, refresh_token }: {
|
|
34
|
+
baseURL?: string | undefined;
|
|
35
|
+
refresh_token?: string | undefined;
|
|
36
|
+
}): Promise<any>;
|
|
37
|
+
setLogger(logger: Logger): void;
|
|
38
|
+
setBaseUrl(url: string): void;
|
|
39
|
+
setClientInfo({ clientId, clientSecret }: {
|
|
40
|
+
clientId: string;
|
|
41
|
+
clientSecret: string;
|
|
42
|
+
}): void;
|
|
43
|
+
setHttpConfig(config: IAxiosRequestConfig): void;
|
|
44
|
+
getApiHeader(params: ISignParams): {
|
|
45
|
+
Authorization?: string | undefined;
|
|
46
|
+
'x-xy-clientid': string;
|
|
47
|
+
'x-xy-clienttype': string;
|
|
48
|
+
'x-xy-nonce': number;
|
|
49
|
+
'x-xy-timestamp': number;
|
|
50
|
+
'x-xy-signtype': string;
|
|
51
|
+
'x-xy-sign': string;
|
|
52
|
+
'x-xy-signatureversion': string;
|
|
53
|
+
};
|
|
54
|
+
setLoginInfo(loginInfo: IToken | null): void;
|
|
55
|
+
getLoginInfo(): any;
|
|
56
|
+
assignOptions: (option?: AxiosRequestConfig) => AxiosRequestConfig & {
|
|
57
|
+
params: any;
|
|
58
|
+
};
|
|
59
|
+
get: (url: string, option?: IAxiosRequestConfig) => any;
|
|
60
|
+
put: (url: string, data?: any, option?: AxiosRequestConfig) => any;
|
|
61
|
+
post: (url: string, data?: any, option?: AxiosRequestConfig) => any;
|
|
62
|
+
delete: (url: string, option?: AxiosRequestConfig) => any;
|
|
63
|
+
}
|
|
64
|
+
export default HttpClient;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TLocale } from 'src/type';
|
|
2
|
-
export declare let locale: TLocale;
|
|
3
|
-
/**
|
|
4
|
-
* 设置语言
|
|
5
|
-
*
|
|
6
|
-
* @param { TLocale } language 语言
|
|
7
|
-
*/
|
|
8
|
-
export declare const setLocale: (language: TLocale) => void;
|
|
1
|
+
import { TLocale } from 'src/type';
|
|
2
|
+
export declare let locale: TLocale;
|
|
3
|
+
/**
|
|
4
|
+
* 设置语言
|
|
5
|
+
*
|
|
6
|
+
* @param { TLocale } language 语言
|
|
7
|
+
*/
|
|
8
|
+
export declare const setLocale: (language: TLocale) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 关闭视频流
|
|
3
|
-
*
|
|
4
|
-
* @param { MediaStream } stream
|
|
5
|
-
*/
|
|
6
|
-
declare const closePreviewStream: (stream: MediaStream) => Promise<void>;
|
|
7
|
-
declare const setOutputAudioDevice: (element: any, outputValue: string) => void;
|
|
8
|
-
export { closePreviewStream, setOutputAudioDevice };
|
|
1
|
+
/**
|
|
2
|
+
* 关闭视频流
|
|
3
|
+
*
|
|
4
|
+
* @param { MediaStream } stream
|
|
5
|
+
*/
|
|
6
|
+
declare const closePreviewStream: (stream: MediaStream) => Promise<void>;
|
|
7
|
+
declare const setOutputAudioDevice: (element: any, outputValue: string) => void;
|
|
8
|
+
export { closePreviewStream, setOutputAudioDevice };
|
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logger 日志打印函数
|
|
3
|
-
*
|
|
4
|
-
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
|
-
* @date 2019-10-22 20:08:33
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @value INFO 所有信息
|
|
9
|
-
* @value DEBUG 所有调试信息
|
|
10
|
-
* @value WARNING 所有警告信息
|
|
11
|
-
* @value ERROR 所有错误信息
|
|
12
|
-
* @value NONE 不打印任何信息
|
|
13
|
-
*/
|
|
14
|
-
declare type TypeLogLevel = 'INFO' | 'DEBUG' | 'WARNING' | 'ERROR' | 'NONE';
|
|
15
|
-
interface ILogLevel {
|
|
16
|
-
INFO: 'INFO';
|
|
17
|
-
DEBUG: 'DEBUG';
|
|
18
|
-
WARNING: 'WARNING';
|
|
19
|
-
ERROR: 'ERROR';
|
|
20
|
-
NONE: 'NONE';
|
|
21
|
-
}
|
|
22
|
-
interface ILog {
|
|
23
|
-
time: number;
|
|
24
|
-
title: string;
|
|
25
|
-
content: string;
|
|
26
|
-
rest: any;
|
|
27
|
-
}
|
|
28
|
-
declare class Logger {
|
|
29
|
-
/**
|
|
30
|
-
* @member { DB } db indexDB数据库
|
|
31
|
-
*/
|
|
32
|
-
private db;
|
|
33
|
-
/**
|
|
34
|
-
* @member { boolean } isArrowUpload 是否运训上传日志到小鱼云服务器
|
|
35
|
-
*/
|
|
36
|
-
private isArrowUpload;
|
|
37
|
-
/**
|
|
38
|
-
* @member { boolean } isAddCache 是否允许缓存写入数据库失败的数据
|
|
39
|
-
*/
|
|
40
|
-
private isAddCache;
|
|
41
|
-
/**
|
|
42
|
-
* @member { ILogLevel } LogLevel 设置日志等级
|
|
43
|
-
*/
|
|
44
|
-
LogLevel: ILogLevel;
|
|
45
|
-
/**
|
|
46
|
-
* @member { string } currentLevel 设置当前日志等级
|
|
47
|
-
*/
|
|
48
|
-
currentLevel: string;
|
|
49
|
-
/**
|
|
50
|
-
* @member { ILog[] } cacheData 缓存日志信息
|
|
51
|
-
*/
|
|
52
|
-
cacheData: ILog[];
|
|
53
|
-
constructor();
|
|
54
|
-
stopDB: () => void;
|
|
55
|
-
openDB: () => void;
|
|
56
|
-
/**
|
|
57
|
-
* 如果db没有开启,那么需要初始话db,并清理之前的数据
|
|
58
|
-
*/
|
|
59
|
-
initDB: () => Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* 设置日志等级
|
|
62
|
-
*
|
|
63
|
-
* @public
|
|
64
|
-
* @param { TypeLogLevel } level 日志等级
|
|
65
|
-
*/
|
|
66
|
-
setLogLevel: (level: TypeLogLevel) => void;
|
|
67
|
-
/**
|
|
68
|
-
* 写入数据库
|
|
69
|
-
*
|
|
70
|
-
* @param { string } title 日志key
|
|
71
|
-
* @param { any } content 日志内容,必须是可序列化的数据
|
|
72
|
-
* @param { any } rest 其他内容,同content
|
|
73
|
-
* @param { any } nowTime 日志写入时间
|
|
74
|
-
*/
|
|
75
|
-
putLog: (title: string, content: any, rest: any, nowTime: any) => Promise<void>;
|
|
76
|
-
/**
|
|
77
|
-
* 控制台输出debug信息,并写入日志
|
|
78
|
-
*
|
|
79
|
-
* @public
|
|
80
|
-
* @param { string } title 日志key
|
|
81
|
-
* @param { any } content 日志内容,必须是可序列化的数据
|
|
82
|
-
* @param { any[] } rest 其他内容,同content
|
|
83
|
-
*/
|
|
84
|
-
debug(title?: string, content?: any, ...rest: any[]): void;
|
|
85
|
-
/**
|
|
86
|
-
* 控制台输出log信息,并写入日志
|
|
87
|
-
* 输出 INFO、WARNING、ERROR 级别的日志信息
|
|
88
|
-
*
|
|
89
|
-
* @public
|
|
90
|
-
* @param { string } title 日志key
|
|
91
|
-
* @param { any } content 日志内容,必须是可序列化的数据
|
|
92
|
-
* @param { any[] } rest 其他内容,同content
|
|
93
|
-
*/
|
|
94
|
-
log(title: string, content?: any, ...rest: any[]): void;
|
|
95
|
-
/**
|
|
96
|
-
* 控制台输出warn信息,并写入日志
|
|
97
|
-
* 输出 WARNING 和 ERROR 级别的日志信息
|
|
98
|
-
*
|
|
99
|
-
* @public
|
|
100
|
-
* @param { string } title 日志key
|
|
101
|
-
* @param { any } content 日志内容,必须是可序列化的数据
|
|
102
|
-
* @param { any[] } rest 其他内容,同content
|
|
103
|
-
*/
|
|
104
|
-
warn(title: string, content?: any, ...rest: any[]): void;
|
|
105
|
-
/**
|
|
106
|
-
* 控制台输出error信息,并写入日志
|
|
107
|
-
* 输出 ERROR 级别的日志信息
|
|
108
|
-
*
|
|
109
|
-
* @public
|
|
110
|
-
* @param { string } title 日志key
|
|
111
|
-
* @param { any } content 日志内容,必须是可序列化的数据
|
|
112
|
-
* @param { any[] } rest 其他内容,同content
|
|
113
|
-
*/
|
|
114
|
-
error(title: any, content?: any, ...rest: any[]): void;
|
|
115
|
-
/**
|
|
116
|
-
* 允许日志上传
|
|
117
|
-
*
|
|
118
|
-
* @public
|
|
119
|
-
*/
|
|
120
|
-
enableLogUpload(): void;
|
|
121
|
-
/**
|
|
122
|
-
* 禁用日志上传
|
|
123
|
-
*
|
|
124
|
-
* @public
|
|
125
|
-
*/
|
|
126
|
-
disableLogUpload(): void;
|
|
127
|
-
/**
|
|
128
|
-
* 下载会议日志数据到本地
|
|
129
|
-
*
|
|
130
|
-
* @public
|
|
131
|
-
*/
|
|
132
|
-
downloadLog: () => Promise<void>;
|
|
133
|
-
/**
|
|
134
|
-
* Upload sdk log file to devops
|
|
135
|
-
*
|
|
136
|
-
* @public
|
|
137
|
-
* @param { string } name 上传文件名
|
|
138
|
-
* @param { string } account 上传账号
|
|
139
|
-
* @param { string } comments 上传时备注信息
|
|
140
|
-
* @returns { boolean } 上传结果
|
|
141
|
-
*/
|
|
142
|
-
uploadLog(name?: string, account?: string, comments?: string): Promise<any>;
|
|
143
|
-
/**
|
|
144
|
-
* 设置Log Server服务器地址
|
|
145
|
-
*
|
|
146
|
-
* @public
|
|
147
|
-
* @param { string } logServer Log服务器地址
|
|
148
|
-
*/
|
|
149
|
-
setLogServer: (logServer: string) => void;
|
|
150
|
-
}
|
|
151
|
-
export default Logger;
|
|
1
|
+
/**
|
|
2
|
+
* Logger 日志打印函数
|
|
3
|
+
*
|
|
4
|
+
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
|
+
* @date 2019-10-22 20:08:33
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @value INFO 所有信息
|
|
9
|
+
* @value DEBUG 所有调试信息
|
|
10
|
+
* @value WARNING 所有警告信息
|
|
11
|
+
* @value ERROR 所有错误信息
|
|
12
|
+
* @value NONE 不打印任何信息
|
|
13
|
+
*/
|
|
14
|
+
declare type TypeLogLevel = 'INFO' | 'DEBUG' | 'WARNING' | 'ERROR' | 'NONE';
|
|
15
|
+
interface ILogLevel {
|
|
16
|
+
INFO: 'INFO';
|
|
17
|
+
DEBUG: 'DEBUG';
|
|
18
|
+
WARNING: 'WARNING';
|
|
19
|
+
ERROR: 'ERROR';
|
|
20
|
+
NONE: 'NONE';
|
|
21
|
+
}
|
|
22
|
+
interface ILog {
|
|
23
|
+
time: number;
|
|
24
|
+
title: string;
|
|
25
|
+
content: string;
|
|
26
|
+
rest: any;
|
|
27
|
+
}
|
|
28
|
+
declare class Logger {
|
|
29
|
+
/**
|
|
30
|
+
* @member { DB } db indexDB数据库
|
|
31
|
+
*/
|
|
32
|
+
private db;
|
|
33
|
+
/**
|
|
34
|
+
* @member { boolean } isArrowUpload 是否运训上传日志到小鱼云服务器
|
|
35
|
+
*/
|
|
36
|
+
private isArrowUpload;
|
|
37
|
+
/**
|
|
38
|
+
* @member { boolean } isAddCache 是否允许缓存写入数据库失败的数据
|
|
39
|
+
*/
|
|
40
|
+
private isAddCache;
|
|
41
|
+
/**
|
|
42
|
+
* @member { ILogLevel } LogLevel 设置日志等级
|
|
43
|
+
*/
|
|
44
|
+
LogLevel: ILogLevel;
|
|
45
|
+
/**
|
|
46
|
+
* @member { string } currentLevel 设置当前日志等级
|
|
47
|
+
*/
|
|
48
|
+
currentLevel: string;
|
|
49
|
+
/**
|
|
50
|
+
* @member { ILog[] } cacheData 缓存日志信息
|
|
51
|
+
*/
|
|
52
|
+
cacheData: ILog[];
|
|
53
|
+
constructor();
|
|
54
|
+
stopDB: () => void;
|
|
55
|
+
openDB: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* 如果db没有开启,那么需要初始话db,并清理之前的数据
|
|
58
|
+
*/
|
|
59
|
+
initDB: () => Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* 设置日志等级
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
* @param { TypeLogLevel } level 日志等级
|
|
65
|
+
*/
|
|
66
|
+
setLogLevel: (level: TypeLogLevel) => void;
|
|
67
|
+
/**
|
|
68
|
+
* 写入数据库
|
|
69
|
+
*
|
|
70
|
+
* @param { string } title 日志key
|
|
71
|
+
* @param { any } content 日志内容,必须是可序列化的数据
|
|
72
|
+
* @param { any } rest 其他内容,同content
|
|
73
|
+
* @param { any } nowTime 日志写入时间
|
|
74
|
+
*/
|
|
75
|
+
putLog: (title: string, content: any, rest: any, nowTime: any) => Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* 控制台输出debug信息,并写入日志
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
* @param { string } title 日志key
|
|
81
|
+
* @param { any } content 日志内容,必须是可序列化的数据
|
|
82
|
+
* @param { any[] } rest 其他内容,同content
|
|
83
|
+
*/
|
|
84
|
+
debug(title?: string, content?: any, ...rest: any[]): void;
|
|
85
|
+
/**
|
|
86
|
+
* 控制台输出log信息,并写入日志
|
|
87
|
+
* 输出 INFO、WARNING、ERROR 级别的日志信息
|
|
88
|
+
*
|
|
89
|
+
* @public
|
|
90
|
+
* @param { string } title 日志key
|
|
91
|
+
* @param { any } content 日志内容,必须是可序列化的数据
|
|
92
|
+
* @param { any[] } rest 其他内容,同content
|
|
93
|
+
*/
|
|
94
|
+
log(title: string, content?: any, ...rest: any[]): void;
|
|
95
|
+
/**
|
|
96
|
+
* 控制台输出warn信息,并写入日志
|
|
97
|
+
* 输出 WARNING 和 ERROR 级别的日志信息
|
|
98
|
+
*
|
|
99
|
+
* @public
|
|
100
|
+
* @param { string } title 日志key
|
|
101
|
+
* @param { any } content 日志内容,必须是可序列化的数据
|
|
102
|
+
* @param { any[] } rest 其他内容,同content
|
|
103
|
+
*/
|
|
104
|
+
warn(title: string, content?: any, ...rest: any[]): void;
|
|
105
|
+
/**
|
|
106
|
+
* 控制台输出error信息,并写入日志
|
|
107
|
+
* 输出 ERROR 级别的日志信息
|
|
108
|
+
*
|
|
109
|
+
* @public
|
|
110
|
+
* @param { string } title 日志key
|
|
111
|
+
* @param { any } content 日志内容,必须是可序列化的数据
|
|
112
|
+
* @param { any[] } rest 其他内容,同content
|
|
113
|
+
*/
|
|
114
|
+
error(title: any, content?: any, ...rest: any[]): void;
|
|
115
|
+
/**
|
|
116
|
+
* 允许日志上传
|
|
117
|
+
*
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
enableLogUpload(): void;
|
|
121
|
+
/**
|
|
122
|
+
* 禁用日志上传
|
|
123
|
+
*
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
disableLogUpload(): void;
|
|
127
|
+
/**
|
|
128
|
+
* 下载会议日志数据到本地
|
|
129
|
+
*
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
132
|
+
downloadLog: () => Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Upload sdk log file to devops
|
|
135
|
+
*
|
|
136
|
+
* @public
|
|
137
|
+
* @param { string } name 上传文件名
|
|
138
|
+
* @param { string } account 上传账号
|
|
139
|
+
* @param { string } comments 上传时备注信息
|
|
140
|
+
* @returns { boolean } 上传结果
|
|
141
|
+
*/
|
|
142
|
+
uploadLog(name?: string, account?: string, comments?: string): Promise<any>;
|
|
143
|
+
/**
|
|
144
|
+
* 设置Log Server服务器地址
|
|
145
|
+
*
|
|
146
|
+
* @public
|
|
147
|
+
* @param { string } logServer Log服务器地址
|
|
148
|
+
*/
|
|
149
|
+
setLogServer: (logServer: string) => void;
|
|
150
|
+
}
|
|
151
|
+
export default Logger;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Websocket connect
|
|
3
|
-
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
4
|
-
* @date 2019-10-24 12:01:27
|
|
5
|
-
*/
|
|
6
|
-
interface socketOptions {
|
|
7
|
-
url: string;
|
|
8
|
-
protocols?: string[];
|
|
9
|
-
pingData?: string;
|
|
10
|
-
pangData?: string;
|
|
11
|
-
openHeatBeat?: boolean;
|
|
12
|
-
autoReConnect?: boolean;
|
|
13
|
-
params?: any;
|
|
14
|
-
}
|
|
15
|
-
declare class Socket {
|
|
16
|
-
socket: WebSocket;
|
|
17
|
-
private messageList;
|
|
18
|
-
private options;
|
|
19
|
-
private headBeatTimer;
|
|
20
|
-
private pangTimer;
|
|
21
|
-
private heatBeatFrequency;
|
|
22
|
-
private timeOffset;
|
|
23
|
-
private reconnectCount;
|
|
24
|
-
private reconnectLimit;
|
|
25
|
-
private lockReconnect;
|
|
26
|
-
private isConnected;
|
|
27
|
-
private isClose;
|
|
28
|
-
private logger;
|
|
29
|
-
private client;
|
|
30
|
-
private reconnectOffset;
|
|
31
|
-
private reconnectTimer;
|
|
32
|
-
constructor(options: socketOptions, client: any);
|
|
33
|
-
connect(isReconnect?: boolean): void;
|
|
34
|
-
addEvent(): void;
|
|
35
|
-
removeEvent(): void;
|
|
36
|
-
onOpenSocket: (e: any) => void;
|
|
37
|
-
onHandleMessage: (e: any) => void;
|
|
38
|
-
onCloseSocket: (e: CloseEvent) => void;
|
|
39
|
-
onErrorSocket: (e: any) => void;
|
|
40
|
-
sendHeartBeat(): void;
|
|
41
|
-
clearTimeout(): void;
|
|
42
|
-
emit(type: string, data: any): void;
|
|
43
|
-
clearPangTimer(): void;
|
|
44
|
-
clearBeatTimer(): void;
|
|
45
|
-
clearReconnectTimer(): void;
|
|
46
|
-
reset(): void;
|
|
47
|
-
on(type: string, fn: any): void;
|
|
48
|
-
close(isReconnect?: boolean): void;
|
|
49
|
-
send(data: any, parse?: boolean, isLog?: boolean): void;
|
|
50
|
-
stopCall(): void;
|
|
51
|
-
reConnect(): void;
|
|
52
|
-
}
|
|
53
|
-
export default Socket;
|
|
1
|
+
/**
|
|
2
|
+
* Websocket connect
|
|
3
|
+
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
4
|
+
* @date 2019-10-24 12:01:27
|
|
5
|
+
*/
|
|
6
|
+
interface socketOptions {
|
|
7
|
+
url: string;
|
|
8
|
+
protocols?: string[];
|
|
9
|
+
pingData?: string;
|
|
10
|
+
pangData?: string;
|
|
11
|
+
openHeatBeat?: boolean;
|
|
12
|
+
autoReConnect?: boolean;
|
|
13
|
+
params?: any;
|
|
14
|
+
}
|
|
15
|
+
declare class Socket {
|
|
16
|
+
socket: WebSocket;
|
|
17
|
+
private messageList;
|
|
18
|
+
private options;
|
|
19
|
+
private headBeatTimer;
|
|
20
|
+
private pangTimer;
|
|
21
|
+
private heatBeatFrequency;
|
|
22
|
+
private timeOffset;
|
|
23
|
+
private reconnectCount;
|
|
24
|
+
private reconnectLimit;
|
|
25
|
+
private lockReconnect;
|
|
26
|
+
private isConnected;
|
|
27
|
+
private isClose;
|
|
28
|
+
private logger;
|
|
29
|
+
private client;
|
|
30
|
+
private reconnectOffset;
|
|
31
|
+
private reconnectTimer;
|
|
32
|
+
constructor(options: socketOptions, client: any);
|
|
33
|
+
connect(isReconnect?: boolean): void;
|
|
34
|
+
addEvent(): void;
|
|
35
|
+
removeEvent(): void;
|
|
36
|
+
onOpenSocket: (e: any) => void;
|
|
37
|
+
onHandleMessage: (e: any) => void;
|
|
38
|
+
onCloseSocket: (e: CloseEvent) => void;
|
|
39
|
+
onErrorSocket: (e: any) => void;
|
|
40
|
+
sendHeartBeat(): void;
|
|
41
|
+
clearTimeout(): void;
|
|
42
|
+
emit(type: string, data: any): void;
|
|
43
|
+
clearPangTimer(): void;
|
|
44
|
+
clearBeatTimer(): void;
|
|
45
|
+
clearReconnectTimer(): void;
|
|
46
|
+
reset(): void;
|
|
47
|
+
on(type: string, fn: any): void;
|
|
48
|
+
close(isReconnect?: boolean): void;
|
|
49
|
+
send(data: any, parse?: boolean, isLog?: boolean): void;
|
|
50
|
+
stopCall(): void;
|
|
51
|
+
reConnect(): void;
|
|
52
|
+
}
|
|
53
|
+
export default Socket;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Store LocalStorage
|
|
3
|
-
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
4
|
-
* @date 2019-11-01 14:36:12
|
|
5
|
-
*/
|
|
6
|
-
interface IStore {
|
|
7
|
-
storage: Storage;
|
|
8
|
-
set: (key: string, value: any) => void;
|
|
9
|
-
get: (key: string) => any;
|
|
10
|
-
remove: (key: string) => void;
|
|
11
|
-
clear: () => void;
|
|
12
|
-
removeList: (array: string[]) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const store: IStore;
|
|
15
|
-
export default store;
|
|
1
|
+
/**
|
|
2
|
+
* Store LocalStorage
|
|
3
|
+
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
4
|
+
* @date 2019-11-01 14:36:12
|
|
5
|
+
*/
|
|
6
|
+
interface IStore {
|
|
7
|
+
storage: Storage;
|
|
8
|
+
set: (key: string, value: any) => void;
|
|
9
|
+
get: (key: string) => any;
|
|
10
|
+
remove: (key: string) => void;
|
|
11
|
+
clear: () => void;
|
|
12
|
+
removeList: (array: string[]) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const store: IStore;
|
|
15
|
+
export default store;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Meeting layout init template data
|
|
3
|
-
*
|
|
4
|
-
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
|
-
* @date 2019-10-24 20:41:38
|
|
6
|
-
*/
|
|
7
|
-
import { ITypeTemplate, ITemplate } from '../type';
|
|
8
|
-
export declare const RATE = 0.5625;
|
|
9
|
-
export declare const HIDE_POSITION: number[];
|
|
10
|
-
export declare const SPEAKER_TEMPLATE: ITypeTemplate;
|
|
11
|
-
export declare const GALLERY_TEMPLATE: ITypeTemplate;
|
|
12
|
-
export declare const COMMON_TEMPLATE: ITemplate;
|
|
13
|
-
export declare const CONTENT_TEMPLATE: ITemplate;
|
|
14
|
-
export declare const TEMPLATE: ITemplate;
|
|
1
|
+
/**
|
|
2
|
+
* Meeting layout init template data
|
|
3
|
+
*
|
|
4
|
+
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
|
+
* @date 2019-10-24 20:41:38
|
|
6
|
+
*/
|
|
7
|
+
import { ITypeTemplate, ITemplate } from '../type';
|
|
8
|
+
export declare const RATE = 0.5625;
|
|
9
|
+
export declare const HIDE_POSITION: number[];
|
|
10
|
+
export declare const SPEAKER_TEMPLATE: ITypeTemplate;
|
|
11
|
+
export declare const GALLERY_TEMPLATE: ITypeTemplate;
|
|
12
|
+
export declare const COMMON_TEMPLATE: ITemplate;
|
|
13
|
+
export declare const CONTENT_TEMPLATE: ITemplate;
|
|
14
|
+
export declare const TEMPLATE: ITemplate;
|