quickvo-sdk-js 1.6.63 → 1.6.71
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-C3ZmwZ-K.js +57 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons.svg +24 -0
- package/dist/index.js +25571 -28002
- package/dist/index.umd.cjs +4 -3
- package/dist/lib-Cen0reYH.js +11194 -0
- package/dist/src/QuickVO.d.ts +15 -25
- package/dist/src/action/ActionSFU.d.ts +52 -27
- package/dist/src/action/Task.d.ts +40 -0
- package/dist/src/base/Base.d.ts +5 -1
- package/dist/src/base/modules/Config.d.ts +14 -17
- package/dist/src/base/modules/Notifys.d.ts +7 -32
- package/dist/src/base/modules/Peer.d.ts +17 -7
- package/dist/src/base/modules/cws/CallsWebSocket.d.ts +12 -11
- package/dist/src/base/modules/cws/CallsWebSocketEvent.d.ts +6 -6
- package/dist/src/base/modules/cws/PrWebSocket.d.ts +7 -6
- package/dist/src/base/modules/cws/callLogStorage.d.ts +18 -0
- package/dist/src/base/modules/cws/quickvoCodecWorkerMain.d.ts +6 -0
- package/dist/src/base/modules/notifyPayloadMap.d.ts +119 -0
- package/dist/src/base/modules/users/Users.d.ts +58 -40
- package/dist/src/base/modules/users/modules/LocalTrackAnalysis.d.ts +6 -2
- package/dist/src/base/modules/users/modules/LocalUser.d.ts +8 -1
- package/dist/src/base/modules/users/modules/RemotePeerTrackAnalysis.d.ts +5 -1
- package/dist/src/base/modules/users/modules/RemoteUser.d.ts +9 -19
- package/dist/src/base/modules/users/modules/RemoteUserP2P.d.ts +15 -3
- package/dist/src/base/modules/users/modules/UserBase.d.ts +35 -96
- package/dist/src/base/modules/users/webrtcRtcStatsByTrack.d.ts +9 -0
- package/dist/src/base/modules/webmDurationFixWorkerMain.d.ts +6 -0
- package/dist/src/enums/eventName.d.ts +3 -1
- package/dist/src/enums/notifyName.d.ts +2 -1
- package/dist/src/index.d.ts +5 -0
- package/dist/src/protos/gen/modules/BaseData_pb.d.ts +94 -0
- package/dist/src/protos/gen/modules/Room_pb.d.ts +2200 -0
- package/dist/src/protos/gen/modules/Rtc_pb.d.ts +70 -0
- package/dist/src/protos/index.d.ts +4 -1
- package/dist/src/protos/protoCodec.d.ts +19 -0
- package/dist/src/protos/protoEvent.d.ts +133 -62
- package/dist/src/protos/protoPako.d.ts +4 -0
- package/dist/src/tools.d.ts +29 -1
- package/dist/src/types.d.ts +42 -68
- package/dist/src/workers/cwsCodec/CwsCodecCore.d.ts +7 -0
- package/dist/src/workers/cwsCodec/CwsCodecWorker.d.ts +15 -0
- package/dist/src/workers/cwsCodec/cwsCodec.worker.d.ts +1 -0
- package/dist/src/workers/cwsCodec/type.d.ts +33 -0
- package/dist/src/workers/webmFix/WebmFixCore.d.ts +3 -0
- package/dist/src/workers/webmFix/WebmFixWorker.d.ts +13 -0
- package/dist/src/workers/webmFix/type.d.ts +22 -0
- package/dist/src/workers/webmFix/webmDurationFixInterop.d.ts +5 -0
- package/dist/src/workers/webmFix/webmFix.worker.d.ts +1 -0
- package/package.json +9 -6
- package/dist/src/action/PublisherController.d.ts +0 -16
- package/dist/src/action/subscriberController.d.ts +0 -15
- package/dist/src/protos/compiled.d.ts +0 -8254
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2';
|
|
2
|
+
import { TrackType } from './Room_pb';
|
|
3
|
+
import { Message } from '@bufbuild/protobuf';
|
|
4
|
+
/**
|
|
5
|
+
* Describes the file modules/Rtc.proto.
|
|
6
|
+
*/
|
|
7
|
+
export declare const file_modules_Rtc: GenFile;
|
|
8
|
+
/**
|
|
9
|
+
* @generated from message com.quick.voice.proto.RtcTrack
|
|
10
|
+
*/
|
|
11
|
+
export type RtcTrack = Message<"com.quick.voice.proto.RtcTrack"> & {
|
|
12
|
+
/**
|
|
13
|
+
* @generated from field: string userId = 1;
|
|
14
|
+
*/
|
|
15
|
+
userId: string;
|
|
16
|
+
/**
|
|
17
|
+
* @generated from field: string mid = 2;
|
|
18
|
+
*/
|
|
19
|
+
mid: string;
|
|
20
|
+
/**
|
|
21
|
+
* @generated from field: string trackName = 3;
|
|
22
|
+
*/
|
|
23
|
+
trackName: string;
|
|
24
|
+
/**
|
|
25
|
+
* 与 Room.proto 中 TrackType 数值一致,避免同 package 下重复枚举符号(buf/protoc 要求)
|
|
26
|
+
*
|
|
27
|
+
* @generated from field: com.quick.voice.proto.TrackType type = 4;
|
|
28
|
+
*/
|
|
29
|
+
type: TrackType;
|
|
30
|
+
/**
|
|
31
|
+
* @generated from field: bool isActive = 5;
|
|
32
|
+
*/
|
|
33
|
+
isActive: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Describes the message com.quick.voice.proto.RtcTrack.
|
|
37
|
+
* Use `create(RtcTrackSchema)` to create a new message.
|
|
38
|
+
*/
|
|
39
|
+
export declare const RtcTrackSchema: GenMessage<RtcTrack>;
|
|
40
|
+
/**
|
|
41
|
+
* @generated from message com.quick.voice.proto.UpdateTrackState
|
|
42
|
+
*/
|
|
43
|
+
export type UpdateTrackState = Message<"com.quick.voice.proto.UpdateTrackState"> & {
|
|
44
|
+
/**
|
|
45
|
+
* @generated from field: string roomId = 1;
|
|
46
|
+
*/
|
|
47
|
+
roomId: string;
|
|
48
|
+
/**
|
|
49
|
+
* @generated from field: repeated com.quick.voice.proto.RtcTrack tracks = 2;
|
|
50
|
+
*/
|
|
51
|
+
tracks: RtcTrack[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Describes the message com.quick.voice.proto.UpdateTrackState.
|
|
55
|
+
* Use `create(UpdateTrackStateSchema)` to create a new message.
|
|
56
|
+
*/
|
|
57
|
+
export declare const UpdateTrackStateSchema: GenMessage<UpdateTrackState>;
|
|
58
|
+
/**
|
|
59
|
+
* @generated from enum com.quick.voice.proto.RtcEvent
|
|
60
|
+
*/
|
|
61
|
+
export declare enum RtcEvent {
|
|
62
|
+
/**
|
|
63
|
+
* @generated from enum value: UpdateTrackActive = 0;
|
|
64
|
+
*/
|
|
65
|
+
UpdateTrackActive = 0
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Describes the enum com.quick.voice.proto.RtcEvent.
|
|
69
|
+
*/
|
|
70
|
+
export declare const RtcEventSchema: GenEnum<RtcEvent>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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,64 +1,131 @@
|
|
|
1
|
+
import { MessageInitShape } from '@bufbuild/protobuf';
|
|
1
2
|
import { K_eventName } from '../enums/eventName';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
3
|
+
import { K_notifyName } from '../enums/notifyName';
|
|
4
|
+
import { CommonRspDecoded } from './protoCodec';
|
|
5
|
+
import * as Room from './gen/modules/Room_pb';
|
|
6
|
+
import * as Rtc from './gen/modules/Rtc_pb';
|
|
7
|
+
/**
|
|
8
|
+
* onMessageFormat 按 event 解析后的 data 类型(与 switch 中 fromBinary 一致)
|
|
9
|
+
*/
|
|
10
|
+
export type OnMessageDataMap = {
|
|
11
|
+
connectCF: Room.ConnectCFRsp;
|
|
12
|
+
genTurnAddress: Room.TurnUrlsResponse;
|
|
13
|
+
publish: Room.PublishRsp;
|
|
14
|
+
joinRoom: Room.JoinRsp;
|
|
15
|
+
joinRoomEx: Room.JoinRsp;
|
|
16
|
+
subscribe: Room.SubscribeRsp;
|
|
17
|
+
closeTrack: Room.CloseTrackRsp;
|
|
18
|
+
syncRoomInfo: Room.SyncRoomInfoRsp;
|
|
19
|
+
onJoinRoom: Room.JoinNotify;
|
|
20
|
+
onJoinRoomBatch: Room.JoinBatchNotify;
|
|
21
|
+
onPublish: Room.PublishNotify;
|
|
22
|
+
onCloseTrack: Room.CloseTrackNotify;
|
|
23
|
+
onTrackInactive: Room.CheckSessionRsq;
|
|
24
|
+
onUpdateCall: Room.UpdateCall;
|
|
25
|
+
onRoomActionChange: Room.RoomGlobalActionChangedNotify;
|
|
26
|
+
onMeetSpecialRolesChange: Room.MeetRolesChangeNotify;
|
|
27
|
+
onUpdatePermissions: Room.UpdatePermissions;
|
|
28
|
+
onUpdatePermissionsBatch: Room.RoomInfoCommonRsp;
|
|
29
|
+
onNetQuality: Room.NetQualityNotify;
|
|
30
|
+
onCDNPlayUrlAdd: Room.CDNPlayAddressNotify;
|
|
31
|
+
onUpdateBehavior: Room.PreventUsersBehaviorNotify;
|
|
32
|
+
onRoomUserSpeech: Room.RoomSpeechNotify;
|
|
33
|
+
onAttemptP2PEx: Room.P2PAvailablePeerNotify;
|
|
34
|
+
onOffer: Room.SdpConsult;
|
|
35
|
+
onAnswer: Room.SdpConsult;
|
|
36
|
+
onCandidate: Room.Candidates;
|
|
37
|
+
onDisconnectedP2P: Room.P2PDisconnectedNotify;
|
|
38
|
+
onQuitRoom: Room.QuitNotify;
|
|
39
|
+
onQuitRoomBatch: Room.QuitBatchNotify;
|
|
40
|
+
onDestroyRoom: Room.QuitNotify;
|
|
41
|
+
/** JSON.parse,结构由服务端约定 */
|
|
42
|
+
debugger: unknown;
|
|
43
|
+
ai: unknown;
|
|
44
|
+
UpdateTrackActive: Rtc.UpdateTrackState;
|
|
32
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* 请求事件对应的响应 data(与 onMessageFormat 中可解析的 event 对齐;未单独解析的为 unknown)
|
|
48
|
+
*/
|
|
33
49
|
export type EventDataRsp = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
[K in K_eventName]: K extends keyof OnMessageDataMap ? OnMessageDataMap[K] : unknown;
|
|
51
|
+
};
|
|
52
|
+
/** 所有 onMessageFormat 可解析出的业务 data 的联合(用于通知回调) */
|
|
53
|
+
export type OnMessageDataUnion = OnMessageDataMap[keyof OnMessageDataMap];
|
|
54
|
+
/** 广播通知:与 cws 内 filterKeys(result, ['code','data','desc']) 一致;data 为联合类型,可按 event 自行收窄 */
|
|
55
|
+
export type CwsNotifyPayloadUnion = {
|
|
56
|
+
code: number;
|
|
57
|
+
desc: string;
|
|
58
|
+
data: OnMessageDataUnion | undefined;
|
|
59
|
+
};
|
|
60
|
+
/** 单个通知事件的回调 payload(与 filterKeys(result, ['code','data','desc']) 一致) */
|
|
61
|
+
export type CwsNotifyPayloadFor<K extends K_notifyName> = {
|
|
62
|
+
code: number;
|
|
63
|
+
desc: string;
|
|
64
|
+
data: K extends keyof OnMessageDataMap ? OnMessageDataMap[K] : undefined;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* cws 广播回调:按事件名推断 payload,例如 `on.onJoinRoom = (e) => e.data` 中 `data` 为 `JoinNotify`
|
|
68
|
+
*/
|
|
69
|
+
export type CallsWebSocketOn = {
|
|
70
|
+
[K in K_notifyName]?: (payload: CwsNotifyPayloadFor<K>) => void;
|
|
71
|
+
} & {
|
|
72
|
+
state?: (state: 'connecting' | 'reconnecting' | 'connected' | 'closed') => void;
|
|
73
|
+
log?: (e: unknown) => void;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* 仅用于类型推断:传入部分 on 回调,获得与事件名对齐的 payload 类型(无需写 `as`)
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const handlers = defineCwsOn({
|
|
80
|
+
* onJoinRoom: (e) => e.data.roomId,
|
|
81
|
+
* onPublish: (e) => e.data.user,
|
|
82
|
+
* })
|
|
83
|
+
* cws.on = { ...cws.on, ...handlers }
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function defineCwsOn<const T extends Partial<CallsWebSocketOn>>(handlers: T): T;
|
|
87
|
+
/** 解析后 data 为业务消息体,不再与 CommonRsp 的 bytes data 共用字段 */
|
|
88
|
+
export type OnMessageFormatResult<E extends string = string> = Omit<CommonRspDecoded, 'data'> & {
|
|
89
|
+
timeStr: string;
|
|
90
|
+
data_remote: Uint8Array;
|
|
91
|
+
data: E extends keyof OnMessageDataMap ? OnMessageDataMap[E] : undefined;
|
|
92
|
+
remoteTime: number;
|
|
93
|
+
remoteTimeStr: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* 各 event 的 send({ data }) 类型:与对应 Req 的 MessageInitShape 一致;sendMessageFormat 内 enc(schema, create(...))
|
|
97
|
+
*/
|
|
98
|
+
export type EventDataReqs = {
|
|
99
|
+
heartbeat: MessageInitShape<typeof Room.ReportTrafficUsageSchema>;
|
|
100
|
+
/** 慢心跳可无字段 */
|
|
101
|
+
heartbeatEx: MessageInitShape<typeof Room.ReportTrafficUsageSchema>;
|
|
102
|
+
ackMsg: MessageInitShape<typeof Room.AckMsgReqSchema>;
|
|
103
|
+
reportNetwork: MessageInitShape<typeof Room.ReportNetInfoSchema>;
|
|
104
|
+
connectCF: MessageInitShape<typeof Room.ConnectCFReqSchema>;
|
|
105
|
+
genTurnAddress: MessageInitShape<typeof Room.TurnUrlsReqSchema>;
|
|
106
|
+
publish: MessageInitShape<typeof Room.PublishReqSchema>;
|
|
107
|
+
joinRoom: MessageInitShape<typeof Room.JoinReqSchema>;
|
|
108
|
+
joinRoomEx: MessageInitShape<typeof Room.JoinReqSchema>;
|
|
109
|
+
pubNotify: MessageInitShape<typeof Room.PublishNotifySchema>;
|
|
110
|
+
subscribe: MessageInitShape<typeof Room.SubscribeReqSchema>;
|
|
111
|
+
renegotiate: MessageInitShape<typeof Room.RenegotiateReqSchema>;
|
|
112
|
+
closeTrack: MessageInitShape<typeof Room.CloseTrackReqSchema>;
|
|
113
|
+
preventUsersBehavior: MessageInitShape<typeof Room.PreventUsersBehaviorReqSchema>;
|
|
114
|
+
networkQualityChange: MessageInitShape<typeof Room.NetQualityChangeSchema>;
|
|
115
|
+
updateCall: MessageInitShape<typeof Room.UpdateCallSchema>;
|
|
116
|
+
toggleRoomSpeechLang: MessageInitShape<typeof Room.AiLangSettingSchema>;
|
|
117
|
+
syncRoomInfo: MessageInitShape<typeof Room.SyncRoomInfoReqSchema>;
|
|
118
|
+
updateSimulcast: MessageInitShape<typeof Room.SubscribeReqSchema>;
|
|
119
|
+
updateRoomToken: MessageInitShape<typeof Room.UpdateTokenReqSchema>;
|
|
120
|
+
offer: MessageInitShape<typeof Room.SdpConsultSchema>;
|
|
121
|
+
answer: MessageInitShape<typeof Room.SdpConsultSchema>;
|
|
122
|
+
candidate: MessageInitShape<typeof Room.CandidatesSchema>;
|
|
123
|
+
reportP2PConnectEx: MessageInitShape<typeof Room.ReportP2PExReqSchema>;
|
|
124
|
+
quitRoom: MessageInitShape<typeof Room.QuitReqSchema>;
|
|
125
|
+
quitRoomEx: MessageInitShape<typeof Room.QuitReqSchema>;
|
|
126
|
+
debugger: Record<string, never>;
|
|
127
|
+
ai: Record<string, never>;
|
|
128
|
+
UpdateTrackActive: MessageInitShape<typeof Rtc.UpdateTrackStateSchema>;
|
|
62
129
|
};
|
|
63
130
|
export interface MessageReq<T extends K_eventName> {
|
|
64
131
|
/**
|
|
@@ -130,6 +197,8 @@ export interface MessageRsp<T extends K_eventName> {
|
|
|
130
197
|
*/
|
|
131
198
|
version: number;
|
|
132
199
|
}
|
|
200
|
+
/** cws 请求-响应实际传递的字段(与 send / resolve 一致) */
|
|
201
|
+
export type MessageRspCore<T extends K_eventName> = Pick<MessageRsp<T>, 'event' | 'sn' | 'data' | 'code' | 'desc'>;
|
|
133
202
|
export interface SendMessageFormat<T extends K_eventName> {
|
|
134
203
|
/**
|
|
135
204
|
* 事件名称
|
|
@@ -167,7 +236,7 @@ export interface SendMessageFormat<T extends K_eventName> {
|
|
|
167
236
|
export declare const sendMessageFormat: <T extends K_eventName>(message: SendMessageFormat<T>) => {
|
|
168
237
|
timeStr: string;
|
|
169
238
|
data_original: EventDataReqs[T];
|
|
170
|
-
data: Uint8Array<
|
|
239
|
+
data: Uint8Array<ArrayBufferLike>;
|
|
171
240
|
/**
|
|
172
241
|
* 事件名称
|
|
173
242
|
*/
|
|
@@ -193,6 +262,8 @@ export declare const sendMessageFormat: <T extends K_eventName>(message: SendMes
|
|
|
193
262
|
*/
|
|
194
263
|
version: number;
|
|
195
264
|
};
|
|
196
|
-
export declare
|
|
197
|
-
|
|
198
|
-
|
|
265
|
+
export declare function onMessageFormat<E extends string = string>(message: CommonRspDecoded & {
|
|
266
|
+
event: E;
|
|
267
|
+
}): OnMessageFormatResult<E>;
|
|
268
|
+
export declare const obj2pb: (message: Record<string, unknown>) => Uint8Array<ArrayBufferLike>;
|
|
269
|
+
export declare const pb2obj: (uint8Array: Uint8Array) => CommonRspDecoded;
|
package/dist/src/tools.d.ts
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
export declare const isMobile: () => boolean;
|
|
2
|
-
export declare const getNetworkQuality: (lostRate: number, roundTripTime: number, jitter: number) =>
|
|
2
|
+
export declare const getNetworkQuality: (lostRate: number, roundTripTime: number, jitter: number) => 2 | 1 | 3 | 4 | 5;
|
|
3
3
|
export declare const availableWeight: number[];
|
|
4
4
|
export declare const estimateDataByResolution: (width: number, height: number) => number;
|
|
5
5
|
export declare const sortByMimeTypes: (codecs: RTCRtpCodec[], preferredOrder: string[]) => RTCRtpCodec[];
|
|
6
|
+
export declare const parseCallAction: (callAction: number) => {
|
|
7
|
+
mc_audio: boolean;
|
|
8
|
+
mc_video: boolean;
|
|
9
|
+
ss_video: boolean;
|
|
10
|
+
ss_audio: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const parsePermissions: (permissions: number) => {
|
|
13
|
+
publish: boolean;
|
|
14
|
+
subscribe: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const parseBehavior: (behavior: number) => {
|
|
17
|
+
mc_audio: boolean;
|
|
18
|
+
mc_video: boolean;
|
|
19
|
+
ss_video: boolean;
|
|
20
|
+
ss_audio: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const parseRoomAction: (roomAction: number) => {
|
|
23
|
+
mc_audio: boolean;
|
|
24
|
+
mc_video: boolean;
|
|
25
|
+
ss_video: boolean;
|
|
26
|
+
ss_audio: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare const parseServerAction: (serverAction: number) => {
|
|
29
|
+
mc_audio: boolean;
|
|
30
|
+
mc_video: boolean;
|
|
31
|
+
ss_video: boolean;
|
|
32
|
+
ss_audio: boolean;
|
|
33
|
+
};
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NotifyEmitPayloadUnion, QuickvoNotify } from './base/modules/notifyPayloadMap';
|
|
2
2
|
import { K_mediaType } from './enums/mediaType';
|
|
3
3
|
import { K_callStrategy } from './enums/callStrategy';
|
|
4
4
|
export interface QuickOptions {
|
|
@@ -74,107 +74,69 @@ export interface RoomOptions {
|
|
|
74
74
|
translateEnable?: boolean;
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
78
|
-
* 用于控制当监听到新媒体轨道发布时 sdk内部是否自动发起订阅并输出最终媒体流
|
|
77
|
+
* 是否自动订阅
|
|
79
78
|
*/
|
|
80
|
-
|
|
79
|
+
autoSubscribe?: {
|
|
80
|
+
[key in K_mediaType]: boolean;
|
|
81
|
+
};
|
|
81
82
|
}
|
|
82
83
|
/**
|
|
83
84
|
* 用户轨道
|
|
84
85
|
*/
|
|
85
86
|
export interface UserTrack {
|
|
86
87
|
/**
|
|
87
|
-
*
|
|
88
|
-
*/
|
|
89
|
-
location: string;
|
|
90
|
-
/**
|
|
91
|
-
* 协商媒体ID
|
|
92
|
-
*/
|
|
93
|
-
mid: string | null;
|
|
94
|
-
/**
|
|
95
|
-
* 远程协商媒体ID
|
|
88
|
+
* 媒体类型
|
|
96
89
|
*/
|
|
97
|
-
|
|
90
|
+
mediaType: K_mediaType;
|
|
98
91
|
/**
|
|
99
92
|
* 轨道名称
|
|
100
93
|
*/
|
|
101
94
|
trackName: string;
|
|
102
95
|
/**
|
|
103
|
-
*
|
|
96
|
+
* 数据来源
|
|
104
97
|
*/
|
|
105
|
-
|
|
98
|
+
origin: 'phoney' | 'local' | 'sfu' | 'p2p';
|
|
106
99
|
/**
|
|
107
|
-
*
|
|
100
|
+
* 当前轨道传输质量(video有效, audio一直为f)
|
|
108
101
|
*/
|
|
109
|
-
|
|
102
|
+
simulcast: 'f' | 'h' | 'q';
|
|
110
103
|
/**
|
|
111
|
-
*
|
|
104
|
+
* 协商媒体位置
|
|
112
105
|
*/
|
|
113
|
-
|
|
106
|
+
location: string;
|
|
114
107
|
/**
|
|
115
|
-
*
|
|
108
|
+
* 协商媒体ID
|
|
116
109
|
*/
|
|
117
|
-
|
|
110
|
+
mid: string;
|
|
118
111
|
/**
|
|
119
|
-
*
|
|
112
|
+
* 远程协商媒体ID
|
|
120
113
|
*/
|
|
121
|
-
|
|
114
|
+
msid: string;
|
|
122
115
|
/**
|
|
123
|
-
*
|
|
116
|
+
* 轨道类型 0 1 2 3
|
|
124
117
|
*/
|
|
125
|
-
|
|
118
|
+
type: number;
|
|
126
119
|
/**
|
|
127
|
-
*
|
|
120
|
+
* 是否开启该轨道
|
|
128
121
|
*/
|
|
129
|
-
|
|
122
|
+
enabled: boolean;
|
|
130
123
|
}
|
|
131
124
|
/**
|
|
132
|
-
*
|
|
125
|
+
* notifys.emit 派发至 callback 的载荷联合(按 event 收窄请用 `NotifyEmitPayloadFor<E>`)
|
|
133
126
|
*/
|
|
134
|
-
export type
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
event: K_notifyName;
|
|
143
|
-
/**
|
|
144
|
-
* 自定义回调函数
|
|
145
|
-
*/
|
|
146
|
-
callback?: (e: any) => void;
|
|
147
|
-
};
|
|
127
|
+
export type NotifyEmitPayload = NotifyEmitPayloadUnion;
|
|
128
|
+
/**
|
|
129
|
+
* 广播(event 与 callback 参数类型联动,见 QuickvoNotify)
|
|
130
|
+
*/
|
|
131
|
+
export type Notify = QuickvoNotify;
|
|
132
|
+
/** QuickVO 通知事件名(`enum_notifyName` + SDK 内部如 onLog、onRoomState) */
|
|
133
|
+
export type { K_quickvoNotifyName, NotifyEmitPayloadFor, NotifyPayloadMap } from './base/modules/notifyPayloadMap';
|
|
134
|
+
export { defineQuickvoNotify } from './base/modules/notifyPayloadMap';
|
|
148
135
|
/**
|
|
149
136
|
* 房间用户
|
|
150
137
|
*/
|
|
151
138
|
export interface RoomUser {
|
|
152
139
|
id: string;
|
|
153
|
-
/**
|
|
154
|
-
* 通话状态
|
|
155
|
-
*/
|
|
156
|
-
callAction: number;
|
|
157
|
-
callActionStr: string;
|
|
158
|
-
callActionMap: {
|
|
159
|
-
[key in K_mediaType]: boolean;
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* 禁止行为
|
|
163
|
-
*/
|
|
164
|
-
banBehavior: number;
|
|
165
|
-
banBehaviorStr: string;
|
|
166
|
-
banBehaviorMap: {
|
|
167
|
-
[key in K_mediaType]: boolean;
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* 用户权限
|
|
171
|
-
*/
|
|
172
|
-
permissions: number;
|
|
173
|
-
permissionsStr: string;
|
|
174
|
-
permissionsMap: {
|
|
175
|
-
subscribe: boolean;
|
|
176
|
-
publish: boolean;
|
|
177
|
-
};
|
|
178
140
|
/**
|
|
179
141
|
* 是否为房间所有者
|
|
180
142
|
*/
|
|
@@ -206,6 +168,18 @@ export interface RoomUser {
|
|
|
206
168
|
*/
|
|
207
169
|
ingress: number;
|
|
208
170
|
};
|
|
171
|
+
/**
|
|
172
|
+
* 通话行为
|
|
173
|
+
*/
|
|
174
|
+
callAction: number;
|
|
175
|
+
/**
|
|
176
|
+
* 用户权限
|
|
177
|
+
*/
|
|
178
|
+
permissions: number;
|
|
179
|
+
/**
|
|
180
|
+
* 禁用行为
|
|
181
|
+
*/
|
|
182
|
+
behavior: number;
|
|
209
183
|
}
|
|
210
184
|
export interface UserMediaTypes {
|
|
211
185
|
userId: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type WebmFixWorkerOptions = {
|
|
2
|
+
onFatal?: () => void;
|
|
3
|
+
};
|
|
4
|
+
export declare class WebmFixWorker {
|
|
5
|
+
worker: Worker;
|
|
6
|
+
private nextId;
|
|
7
|
+
private pending;
|
|
8
|
+
private options;
|
|
9
|
+
constructor(options?: WebmFixWorkerOptions);
|
|
10
|
+
private failAll;
|
|
11
|
+
fix(buffer: ArrayBuffer, mimeType: string): Promise<Blob>;
|
|
12
|
+
destroy: () => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type WebmFixWorkerRequest = {
|
|
2
|
+
id: number;
|
|
3
|
+
action: 'fix';
|
|
4
|
+
data: {
|
|
5
|
+
buffer: ArrayBuffer;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
};
|
|
8
|
+
} | {
|
|
9
|
+
id: number;
|
|
10
|
+
action: 'destroy';
|
|
11
|
+
data?: Record<string, never>;
|
|
12
|
+
};
|
|
13
|
+
export type WebmFixWorkerResponse = {
|
|
14
|
+
id: number;
|
|
15
|
+
ok: true;
|
|
16
|
+
buffer: ArrayBuffer;
|
|
17
|
+
mimeType: string;
|
|
18
|
+
} | {
|
|
19
|
+
id: number;
|
|
20
|
+
ok: false;
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|