@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,67 +1,73 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tools function
|
|
3
|
-
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
4
|
-
* @date 2019-11-08 15:54:21
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* 节流函数
|
|
8
|
-
*
|
|
9
|
-
* @param fn event function
|
|
10
|
-
* @param delay 每隔多久必须触发一次
|
|
11
|
-
* @param atleast 最短间隔触发时间
|
|
12
|
-
*/
|
|
13
|
-
export declare const debounce: (fn: any, delay: number, atleast: number) => () => void;
|
|
14
|
-
/**
|
|
15
|
-
* 防抖函数
|
|
16
|
-
*
|
|
17
|
-
* @param fn Event function
|
|
18
|
-
* @param wait 等待多少毫秒触发
|
|
19
|
-
*/
|
|
20
|
-
export declare const throttle: (fn: any, wait: number) => () => void;
|
|
21
|
-
/**
|
|
22
|
-
* 获取当前时间
|
|
23
|
-
*
|
|
24
|
-
* Format:xxxx-xx-xx xx:xx
|
|
25
|
-
*/
|
|
26
|
-
export declare const currentTime: () => string;
|
|
27
|
-
/**
|
|
28
|
-
* 获取当前时间
|
|
29
|
-
*
|
|
30
|
-
* Format:xxxx-xx-xx xx:xx:xx xx
|
|
31
|
-
*/
|
|
32
|
-
export declare const getTime: () => string;
|
|
33
|
-
/**
|
|
34
|
-
* 获取当前时间
|
|
35
|
-
*
|
|
36
|
-
* Format:xx:xx:xx xx
|
|
37
|
-
*/
|
|
38
|
-
export declare const getMillTime: () => string;
|
|
39
|
-
/**
|
|
40
|
-
* 获取时间戳差值
|
|
41
|
-
* @param time1
|
|
42
|
-
* @param time2
|
|
43
|
-
* @param format
|
|
44
|
-
*/
|
|
45
|
-
export declare const diffTime: (time1: number, time2: number, format?: string) => number;
|
|
46
|
-
export declare function mapToObj<T>(data: Map<string, T>): {
|
|
47
|
-
[key: string]: T;
|
|
48
|
-
};
|
|
49
|
-
export declare const getStatus: (code: string, detail?: any, msg?: string) => {
|
|
50
|
-
code: string;
|
|
51
|
-
msg: string;
|
|
52
|
-
detail: any;
|
|
53
|
-
};
|
|
54
|
-
export declare const getMeetingStatus: (success: boolean, code?: string, msg?: string) => {
|
|
55
|
-
success: boolean;
|
|
56
|
-
data: {
|
|
57
|
-
code: string;
|
|
58
|
-
msg: string | undefined;
|
|
59
|
-
};
|
|
60
|
-
} | {
|
|
61
|
-
success: boolean;
|
|
62
|
-
data: {
|
|
63
|
-
code?: undefined;
|
|
64
|
-
msg?: undefined;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export declare const hideKeyInfo: (data: any, key: string | string[]) => any;
|
|
1
|
+
/**
|
|
2
|
+
* Tools function
|
|
3
|
+
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
4
|
+
* @date 2019-11-08 15:54:21
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 节流函数
|
|
8
|
+
*
|
|
9
|
+
* @param fn event function
|
|
10
|
+
* @param delay 每隔多久必须触发一次
|
|
11
|
+
* @param atleast 最短间隔触发时间
|
|
12
|
+
*/
|
|
13
|
+
export declare const debounce: (fn: any, delay: number, atleast: number) => () => void;
|
|
14
|
+
/**
|
|
15
|
+
* 防抖函数
|
|
16
|
+
*
|
|
17
|
+
* @param fn Event function
|
|
18
|
+
* @param wait 等待多少毫秒触发
|
|
19
|
+
*/
|
|
20
|
+
export declare const throttle: (fn: any, wait: number) => () => void;
|
|
21
|
+
/**
|
|
22
|
+
* 获取当前时间
|
|
23
|
+
*
|
|
24
|
+
* Format:xxxx-xx-xx xx:xx
|
|
25
|
+
*/
|
|
26
|
+
export declare const currentTime: () => string;
|
|
27
|
+
/**
|
|
28
|
+
* 获取当前时间
|
|
29
|
+
*
|
|
30
|
+
* Format:xxxx-xx-xx xx:xx:xx xx
|
|
31
|
+
*/
|
|
32
|
+
export declare const getTime: () => string;
|
|
33
|
+
/**
|
|
34
|
+
* 获取当前时间
|
|
35
|
+
*
|
|
36
|
+
* Format:xx:xx:xx xx
|
|
37
|
+
*/
|
|
38
|
+
export declare const getMillTime: () => string;
|
|
39
|
+
/**
|
|
40
|
+
* 获取时间戳差值
|
|
41
|
+
* @param time1
|
|
42
|
+
* @param time2
|
|
43
|
+
* @param format
|
|
44
|
+
*/
|
|
45
|
+
export declare const diffTime: (time1: number, time2: number, format?: string) => number;
|
|
46
|
+
export declare function mapToObj<T>(data: Map<string, T>): {
|
|
47
|
+
[key: string]: T;
|
|
48
|
+
};
|
|
49
|
+
export declare const getStatus: (code: string, detail?: any, msg?: string) => {
|
|
50
|
+
code: string;
|
|
51
|
+
msg: string;
|
|
52
|
+
detail: any;
|
|
53
|
+
};
|
|
54
|
+
export declare const getMeetingStatus: (success: boolean, code?: string, msg?: string) => {
|
|
55
|
+
success: boolean;
|
|
56
|
+
data: {
|
|
57
|
+
code: string;
|
|
58
|
+
msg: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
success: boolean;
|
|
62
|
+
data: {
|
|
63
|
+
code?: undefined;
|
|
64
|
+
msg?: undefined;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export declare const hideKeyInfo: (data: any, key: string | string[]) => any;
|
|
68
|
+
export declare const TYPEOF: {
|
|
69
|
+
isNumber(num: any): boolean;
|
|
70
|
+
isObject(obj: any): boolean;
|
|
71
|
+
isArray(arr: any): boolean;
|
|
72
|
+
isString(str: any): boolean;
|
|
73
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 校验 request 参数
|
|
3
|
-
*
|
|
4
|
-
* @param reqList
|
|
5
|
-
* @returns isValid true:有效, false: 无效
|
|
6
|
-
*/
|
|
7
|
-
export declare const verifyReqListParams: (reqList: any) => boolean;
|
|
1
|
+
/**
|
|
2
|
+
* 校验 request 参数
|
|
3
|
+
*
|
|
4
|
+
* @param reqList
|
|
5
|
+
* @returns isValid true:有效, false: 无效
|
|
6
|
+
*/
|
|
7
|
+
export declare const verifyReqListParams: (reqList: any) => boolean;
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SDK对外回调错误消息
|
|
3
|
-
*
|
|
4
|
-
* @property { string } code 错误码
|
|
5
|
-
* @property { string } msg 错误信息
|
|
6
|
-
* @property { any } detail 数据详情
|
|
7
|
-
*/
|
|
8
|
-
export interface IStatus {
|
|
9
|
-
code: string;
|
|
10
|
-
msg: string;
|
|
11
|
-
detail: any;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* 国际化,目前只支持 英文、中文、繁体
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
export declare type TLocale = 'en_US' | 'zh_CN' | 'zh_TW';
|
|
18
|
-
/**
|
|
19
|
-
* 是否支持入会
|
|
20
|
-
*/
|
|
21
|
-
export interface ICheckSystemRequirements {
|
|
22
|
-
result: boolean;
|
|
23
|
-
detail: {
|
|
24
|
-
isSupportRTC: boolean;
|
|
25
|
-
isSupportWebsocket: boolean;
|
|
26
|
-
isSupportBrowser: boolean;
|
|
27
|
-
isSupportMobileBrowser: boolean;
|
|
28
|
-
isSupportH264: boolean;
|
|
29
|
-
isSupportAddTransceiver: boolean;
|
|
30
|
-
isSupportAddtrack: boolean;
|
|
31
|
-
isSupportUserMedia: boolean;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* token 信息
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
export interface IToken {
|
|
39
|
-
access_token: string;
|
|
40
|
-
signSecret: string;
|
|
41
|
-
refresh_token?: string;
|
|
42
|
-
domain?: string;
|
|
43
|
-
expires_in?: number;
|
|
44
|
-
openid?: string;
|
|
45
|
-
scope?: string;
|
|
46
|
-
token_type?: string;
|
|
47
|
-
}
|
|
48
|
-
export declare type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
49
|
-
/**
|
|
50
|
-
* API网关 签名参数
|
|
51
|
-
*
|
|
52
|
-
* @property { Method } method 请求方法
|
|
53
|
-
* @property { string } url 请求url, 包含query参数
|
|
54
|
-
* @property { string } body 请求体, 需进行json转换, 无请求体,则传入""
|
|
55
|
-
* @property { string } clientId
|
|
56
|
-
* @property { string } clienttype
|
|
57
|
-
* @property { string } clientSecret 签名秘钥: 此密钥为网关平台颁发的ClientSecret. 未登录时,需传入此值
|
|
58
|
-
* @property { string } token 需进行token校验的,必须传入此值
|
|
59
|
-
* @property { string } signSecret 需进行token校验的,必须传入此值
|
|
60
|
-
*/
|
|
61
|
-
export interface ISignParams {
|
|
62
|
-
method: string;
|
|
63
|
-
url: string;
|
|
64
|
-
body: string;
|
|
65
|
-
clientId: string;
|
|
66
|
-
clienttype: string;
|
|
67
|
-
clientSecret: string;
|
|
68
|
-
token: string;
|
|
69
|
-
signSecret: string;
|
|
70
|
-
}
|
|
71
|
-
export declare type Key = string | number;
|
|
1
|
+
/**
|
|
2
|
+
* SDK对外回调错误消息
|
|
3
|
+
*
|
|
4
|
+
* @property { string } code 错误码
|
|
5
|
+
* @property { string } msg 错误信息
|
|
6
|
+
* @property { any } detail 数据详情
|
|
7
|
+
*/
|
|
8
|
+
export interface IStatus {
|
|
9
|
+
code: string;
|
|
10
|
+
msg: string;
|
|
11
|
+
detail: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 国际化,目前只支持 英文、中文、繁体
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare type TLocale = 'en_US' | 'zh_CN' | 'zh_TW';
|
|
18
|
+
/**
|
|
19
|
+
* 是否支持入会
|
|
20
|
+
*/
|
|
21
|
+
export interface ICheckSystemRequirements {
|
|
22
|
+
result: boolean;
|
|
23
|
+
detail: {
|
|
24
|
+
isSupportRTC: boolean;
|
|
25
|
+
isSupportWebsocket: boolean;
|
|
26
|
+
isSupportBrowser: boolean;
|
|
27
|
+
isSupportMobileBrowser: boolean;
|
|
28
|
+
isSupportH264: boolean;
|
|
29
|
+
isSupportAddTransceiver: boolean;
|
|
30
|
+
isSupportAddtrack: boolean;
|
|
31
|
+
isSupportUserMedia: boolean;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* token 信息
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export interface IToken {
|
|
39
|
+
access_token: string;
|
|
40
|
+
signSecret: string;
|
|
41
|
+
refresh_token?: string;
|
|
42
|
+
domain?: string;
|
|
43
|
+
expires_in?: number;
|
|
44
|
+
openid?: string;
|
|
45
|
+
scope?: string;
|
|
46
|
+
token_type?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
49
|
+
/**
|
|
50
|
+
* API网关 签名参数
|
|
51
|
+
*
|
|
52
|
+
* @property { Method } method 请求方法
|
|
53
|
+
* @property { string } url 请求url, 包含query参数
|
|
54
|
+
* @property { string } body 请求体, 需进行json转换, 无请求体,则传入""
|
|
55
|
+
* @property { string } clientId
|
|
56
|
+
* @property { string } clienttype
|
|
57
|
+
* @property { string } clientSecret 签名秘钥: 此密钥为网关平台颁发的ClientSecret. 未登录时,需传入此值
|
|
58
|
+
* @property { string } token 需进行token校验的,必须传入此值
|
|
59
|
+
* @property { string } signSecret 需进行token校验的,必须传入此值
|
|
60
|
+
*/
|
|
61
|
+
export interface ISignParams {
|
|
62
|
+
method: string;
|
|
63
|
+
url: string;
|
|
64
|
+
body: string;
|
|
65
|
+
clientId: string;
|
|
66
|
+
clienttype: string;
|
|
67
|
+
clientSecret: string;
|
|
68
|
+
token: string;
|
|
69
|
+
signSecret: string;
|
|
70
|
+
}
|
|
71
|
+
export declare type Key = string | number;
|