quickvo-sdk-js 1.6.72 → 1.6.74
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/dist/chunk-CurYBBhZ.js +58 -0
- package/dist/index.js +16702 -16979
- package/dist/index.umd.cjs +4 -4
- package/dist/lib-grgbKEh8.js +11177 -0
- package/dist/src/QuickVO.d.ts +5 -5
- package/dist/src/action/ActionSFU.d.ts +7 -31
- package/dist/src/action/Task.d.ts +3 -27
- package/dist/src/base/Base.d.ts +1 -1
- package/dist/src/base/modules/Notifys.d.ts +15 -5
- package/dist/src/base/modules/Peer.d.ts +12 -8
- package/dist/src/base/modules/cws/CallsWebSocket.d.ts +34 -22
- package/dist/src/base/modules/cws/CallsWebSocketEvent.d.ts +7 -8
- package/dist/src/base/modules/cws/PrWebSocket.d.ts +2 -0
- package/dist/src/base/modules/users/Users.d.ts +3 -3
- package/dist/src/base/modules/users/modules/RemoteUser.d.ts +1 -1
- package/dist/src/base/modules/users/modules/RemoteUserP2P.d.ts +3 -5
- package/dist/src/base/modules/users/modules/UserBase.d.ts +15 -2
- package/dist/src/base/modules/webmDurationFixWorkerMain.d.ts +2 -0
- package/dist/src/enums/eventName.d.ts +4 -4
- package/dist/src/enums/mediaType.d.ts +1 -1
- package/dist/src/enums/notifyName.d.ts +2 -1
- package/dist/src/index.d.ts +0 -4
- package/dist/src/protos/gen/{modules/BaseData_pb.d.ts → BaseData_pb.d.ts} +2 -2
- package/dist/src/protos/gen/{modules/Room_pb.d.ts → Room_pb.d.ts} +16 -22
- package/dist/src/protos/gen/{modules/Rtc_pb.d.ts → Rtc_pb.d.ts} +20 -4
- package/dist/src/protos/index.d.ts +3 -4
- package/dist/src/protos/protoEvent.d.ts +72 -150
- package/dist/src/tools.d.ts +1 -1
- package/dist/src/types.d.ts +0 -12
- package/dist/src/workers/protos/WorkerCore.d.ts +8 -0
- package/dist/src/workers/protos/index.d.ts +10 -0
- package/dist/src/workers/protos/types.d.ts +8 -0
- package/package.json +6 -5
- package/dist/chunk-763Ozoio.js +0 -57
- package/dist/index.d.ts +0 -2
- package/dist/lib-BMLdj_6t.js +0 -11058
- package/dist/src/base/modules/cws/quickvoCodecWorkerMain.d.ts +0 -6
- package/dist/src/base/modules/notifyPayloadMap.d.ts +0 -119
- package/dist/src/protos/protoCodec.d.ts +0 -19
- package/dist/src/workers/cwsCodec/CwsCodecCore.d.ts +0 -7
- package/dist/src/workers/cwsCodec/CwsCodecWorker.d.ts +0 -15
- package/dist/src/workers/cwsCodec/type.d.ts +0 -33
- /package/dist/src/workers/{cwsCodec/cwsCodec.worker.d.ts → protos/protos.worker.d.ts} +0 -0
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { OnMessageFormatResult } from '../../../protos/protoEvent';
|
|
2
|
-
export declare function decodeCwsBinary<E extends string = string>(buffer: ArrayBuffer): Promise<OnMessageFormatResult<E>>;
|
|
3
|
-
/** gzip 压缩(发送侧 / 日志上报);失败时回退主线程 pako */
|
|
4
|
-
export declare function gzipCompressBytes(data: Uint8Array): Promise<Uint8Array>;
|
|
5
|
-
/** 终止 CWS 编解码 Worker;`QuickVO.destroy` 时应调用。之后可再次懒创建 Worker。 */
|
|
6
|
-
export declare function destroyQuickvoCodecWorker(): void;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { K_notifyName } from '../../enums/notifyName';
|
|
2
|
-
import { K_roomState } from '../../enums/roomState';
|
|
3
|
-
import { CwsNotifyPayloadFor } from '../../protos/protoEvent';
|
|
4
|
-
import { RoomUser } from '../../types';
|
|
5
|
-
/**
|
|
6
|
-
* SDK 内部派发的通知名(不经由 CWS OnMessageDataMap)
|
|
7
|
-
*/
|
|
8
|
-
export type SdkOnlyNotifyName = 'onLog' | 'onRoomUsers' | 'onRoomNetwork' | 'onDevicechange' | 'onPeerState' | 'onRoomState';
|
|
9
|
-
/** QuickVO.addNotify / Notifys 支持的完整事件名 */
|
|
10
|
-
export type K_quickvoNotifyName = K_notifyName | SdkOnlyNotifyName;
|
|
11
|
-
type WithSn<T> = T & {
|
|
12
|
-
sn?: string;
|
|
13
|
-
};
|
|
14
|
-
type CwsNotifyPayloadWithSn<K extends K_notifyName> = WithSn<CwsNotifyPayloadFor<K>>;
|
|
15
|
-
/** 与 Config.network / ActionSFU 网络汇总一致 */
|
|
16
|
-
export type RoomNetworkNotifyData = {
|
|
17
|
-
sfu: {
|
|
18
|
-
inboundBytes: number;
|
|
19
|
-
outboundBytes: number;
|
|
20
|
-
lostRate: number;
|
|
21
|
-
roundTripTime: number;
|
|
22
|
-
jitter: number;
|
|
23
|
-
quality: number;
|
|
24
|
-
averageQuality: number;
|
|
25
|
-
velocityPush: number;
|
|
26
|
-
velocityPull: number;
|
|
27
|
-
};
|
|
28
|
-
p2p: {
|
|
29
|
-
inboundBytes: number;
|
|
30
|
-
outboundBytes: number;
|
|
31
|
-
lostRate: number;
|
|
32
|
-
roundTripTime: number;
|
|
33
|
-
jitter: number;
|
|
34
|
-
quality: number;
|
|
35
|
-
averageQuality: number;
|
|
36
|
-
velocityPush: number;
|
|
37
|
-
velocityPull: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
/** 与 Base._reportLog 的 type 参数一致 */
|
|
41
|
-
export type ReportLogNotifyType = 'ws_c_timeout' | 'webrtc_c_timeout' | 'join_room_error' | 'publish_error' | 'subscribe_error' | 'close_track_error' | 'heartbeat_e_timeout' | 'heartbeat_i_timeout' | 'quit_room_error';
|
|
42
|
-
/**
|
|
43
|
-
* 各通知事件 emit 第二参 / callback 第一参的精确类型
|
|
44
|
-
*/
|
|
45
|
-
export type NotifyPayloadMap = {
|
|
46
|
-
[K in K_notifyName]: CwsNotifyPayloadWithSn<K>;
|
|
47
|
-
} & {
|
|
48
|
-
onLog: WithSn<{
|
|
49
|
-
code: number;
|
|
50
|
-
desc: string;
|
|
51
|
-
data: {
|
|
52
|
-
message: unknown;
|
|
53
|
-
} | {
|
|
54
|
-
type: ReportLogNotifyType;
|
|
55
|
-
};
|
|
56
|
-
}>;
|
|
57
|
-
onRoomUsers: WithSn<{
|
|
58
|
-
code: number;
|
|
59
|
-
desc: string;
|
|
60
|
-
data: RoomUser[];
|
|
61
|
-
}>;
|
|
62
|
-
onRoomNetwork: WithSn<{
|
|
63
|
-
code: number;
|
|
64
|
-
desc: string;
|
|
65
|
-
data: RoomNetworkNotifyData;
|
|
66
|
-
}>;
|
|
67
|
-
onDevicechange: WithSn<{
|
|
68
|
-
code: number;
|
|
69
|
-
desc: string;
|
|
70
|
-
data: Record<string, never>;
|
|
71
|
-
}>;
|
|
72
|
-
onPeerState: WithSn<{
|
|
73
|
-
code: number;
|
|
74
|
-
desc: string;
|
|
75
|
-
data: {
|
|
76
|
-
state: RTCPeerConnectionState;
|
|
77
|
-
};
|
|
78
|
-
}>;
|
|
79
|
-
onRoomState: WithSn<{
|
|
80
|
-
code: number;
|
|
81
|
-
desc: string;
|
|
82
|
-
data: {
|
|
83
|
-
state: K_roomState;
|
|
84
|
-
};
|
|
85
|
-
}>;
|
|
86
|
-
};
|
|
87
|
-
export type NotifyEmitPayloadFor<E extends K_quickvoNotifyName> = NotifyPayloadMap[E];
|
|
88
|
-
/** 所有通知 payload 的联合(需按 event 收窄时请用 NotifyEmitPayloadFor<E>) */
|
|
89
|
-
export type NotifyEmitPayloadUnion = NotifyPayloadMap[K_quickvoNotifyName];
|
|
90
|
-
/**
|
|
91
|
-
* addNotify 注册的 discriminated union:event 与 callback 参数类型联动
|
|
92
|
-
*/
|
|
93
|
-
export type QuickvoNotify = {
|
|
94
|
-
[E in K_quickvoNotifyName]: {
|
|
95
|
-
sn?: string;
|
|
96
|
-
event: E;
|
|
97
|
-
callback?: (e: NotifyPayloadMap[E]) => void;
|
|
98
|
-
};
|
|
99
|
-
}[K_quickvoNotifyName];
|
|
100
|
-
/**
|
|
101
|
-
* 辅助推断:注册通知时无需手写 payload 泛型
|
|
102
|
-
* @example
|
|
103
|
-
* ```ts
|
|
104
|
-
* quickvo.addNotify(defineQuickvoNotify({
|
|
105
|
-
* event: 'onJoinRoom',
|
|
106
|
-
* callback: (e) => e.data.user,
|
|
107
|
-
* }))
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
export declare function defineQuickvoNotify<const E extends K_quickvoNotifyName>(notify: {
|
|
111
|
-
sn?: string;
|
|
112
|
-
event: E;
|
|
113
|
-
callback?: (e: NotifyPayloadMap[E]) => void;
|
|
114
|
-
}): {
|
|
115
|
-
sn?: string;
|
|
116
|
-
event: E;
|
|
117
|
-
callback?: (e: NotifyPayloadMap[E]) => void;
|
|
118
|
-
};
|
|
119
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CommonRsp } from './gen/modules/BaseData_pb';
|
|
2
|
-
/** 与原先 protobufjs 在业务侧用法对齐:CommonRsp 外层 sn/time/valid 使用 number */
|
|
3
|
-
export type CommonRspDecoded = Omit<CommonRsp, 'sn' | 'time' | 'valid'> & {
|
|
4
|
-
sn: number;
|
|
5
|
-
time: number;
|
|
6
|
-
valid: number;
|
|
7
|
-
};
|
|
8
|
-
/** @bufbuild/protobuf 解码后的消息会带运行时字段 `$typeName`,业务/日志里不需要,递归去掉 */
|
|
9
|
-
export declare function stripProtobufRuntimeMeta<T>(value: T): T;
|
|
10
|
-
export declare function decodeCommonRsp(buffer: Uint8Array): CommonRspDecoded;
|
|
11
|
-
export declare function encodeCommonReq(init: {
|
|
12
|
-
event: string;
|
|
13
|
-
data: Uint8Array;
|
|
14
|
-
sn?: number;
|
|
15
|
-
time?: number;
|
|
16
|
-
valid?: number;
|
|
17
|
-
version?: number;
|
|
18
|
-
compress?: boolean;
|
|
19
|
-
}): Uint8Array;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { OnMessageFormatResult } from '../../protos/protoEvent';
|
|
2
|
-
export type CwsCodecWorkerOptions = {
|
|
3
|
-
onFatal?: () => void;
|
|
4
|
-
};
|
|
5
|
-
export declare class CwsCodecWorker {
|
|
6
|
-
worker: Worker;
|
|
7
|
-
private nextId;
|
|
8
|
-
private pending;
|
|
9
|
-
private options;
|
|
10
|
-
constructor(options?: CwsCodecWorkerOptions);
|
|
11
|
-
private failAll;
|
|
12
|
-
decode(buffer: ArrayBuffer): Promise<OnMessageFormatResult>;
|
|
13
|
-
gzipCompress(buffer: ArrayBuffer): Promise<Uint8Array>;
|
|
14
|
-
destroy: () => void;
|
|
15
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { OnMessageFormatResult } from '../../protos/protoEvent';
|
|
2
|
-
export type CwsCodecWorkerRequest = {
|
|
3
|
-
id: number;
|
|
4
|
-
action: 'decode';
|
|
5
|
-
data: {
|
|
6
|
-
buffer: ArrayBuffer;
|
|
7
|
-
};
|
|
8
|
-
} | {
|
|
9
|
-
id: number;
|
|
10
|
-
action: 'gzipCompress';
|
|
11
|
-
data: {
|
|
12
|
-
buffer: ArrayBuffer;
|
|
13
|
-
};
|
|
14
|
-
} | {
|
|
15
|
-
id: number;
|
|
16
|
-
action: 'destroy';
|
|
17
|
-
data?: Record<string, never>;
|
|
18
|
-
};
|
|
19
|
-
export type CwsCodecWorkerResponse = {
|
|
20
|
-
id: number;
|
|
21
|
-
ok: true;
|
|
22
|
-
kind: 'decode';
|
|
23
|
-
result: OnMessageFormatResult;
|
|
24
|
-
} | {
|
|
25
|
-
id: number;
|
|
26
|
-
ok: true;
|
|
27
|
-
kind: 'gzipCompress';
|
|
28
|
-
buffer: ArrayBuffer;
|
|
29
|
-
} | {
|
|
30
|
-
id: number;
|
|
31
|
-
ok: false;
|
|
32
|
-
error: string;
|
|
33
|
-
};
|
|
File without changes
|