浏览代码

feat(ts) TypeScript enum for SignalingEvents

dev1
Gary Hunt 3 年前
父节点
当前提交
c33f7c2bd9
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 37 次插入27 次删除
  1. 0
    14
      service/RTC/SignalingEvents.js
  2. 20
    0
      service/RTC/SignalingEvents.ts
  3. 17
    13
      types/auto/service/RTC/SignalingEvents.d.ts

+ 0
- 14
service/RTC/SignalingEvents.js 查看文件

1
-/**
2
- * Event triggered when participant's muted status changes.
3
- * @param {string} endpointId the track owner's identifier (MUC nickname)
4
- * @param {MediaType} mediaType "audio" or "video"
5
- * @param {boolean} isMuted the new muted state
6
- */
7
-export const PEER_MUTED_CHANGED = 'signaling.peerMuted';
8
-
9
-/**
10
- * Event triggered when participant's video type changes.
11
- * @param {string} endpointId the video owner's ID (MUC nickname)
12
- * @param {VideoType} videoType the new value
13
- */
14
-export const PEER_VIDEO_TYPE_CHANGED = 'signaling.peerVideoType';

+ 20
- 0
service/RTC/SignalingEvents.ts 查看文件

1
+export enum SignalingEvents {
2
+    /**
3
+     * Event triggered when participant's muted status changes.
4
+     * @param {string} endpointId the track owner's identifier (MUC nickname)
5
+     * @param {MediaType} mediaType "audio" or "video"
6
+     * @param {boolean} isMuted the new muted state
7
+     */
8
+    PEER_MUTED_CHANGED = 'signaling.peerMuted',
9
+
10
+    /**
11
+     * Event triggered when participant's video type changes.
12
+     * @param {string} endpointId the video owner's ID (MUC nickname)
13
+     * @param {VideoType} videoType the new value
14
+     */
15
+    PEER_VIDEO_TYPE_CHANGED = 'signaling.peerVideoType'
16
+}
17
+
18
+// exported for backward compatibility
19
+export const PEER_MUTED_CHANGED = SignalingEvents.PEER_MUTED_CHANGED;
20
+export const PEER_VIDEO_TYPE_CHANGED = SignalingEvents.PEER_VIDEO_TYPE_CHANGED;

+ 17
- 13
types/auto/service/RTC/SignalingEvents.d.ts 查看文件

1
-/**
2
- * Event triggered when participant's muted status changes.
3
- * @param {string} endpointId the track owner's identifier (MUC nickname)
4
- * @param {MediaType} mediaType "audio" or "video"
5
- * @param {boolean} isMuted the new muted state
6
- */
7
-export const PEER_MUTED_CHANGED: "signaling.peerMuted";
8
-/**
9
- * Event triggered when participant's video type changes.
10
- * @param {string} endpointId the video owner's ID (MUC nickname)
11
- * @param {VideoType} videoType the new value
12
- */
13
-export const PEER_VIDEO_TYPE_CHANGED: "signaling.peerVideoType";
1
+export declare enum SignalingEvents {
2
+    /**
3
+     * Event triggered when participant's muted status changes.
4
+     * @param {string} endpointId the track owner's identifier (MUC nickname)
5
+     * @param {MediaType} mediaType "audio" or "video"
6
+     * @param {boolean} isMuted the new muted state
7
+     */
8
+    PEER_MUTED_CHANGED = "signaling.peerMuted",
9
+    /**
10
+     * Event triggered when participant's video type changes.
11
+     * @param {string} endpointId the video owner's ID (MUC nickname)
12
+     * @param {VideoType} videoType the new value
13
+     */
14
+    PEER_VIDEO_TYPE_CHANGED = "signaling.peerVideoType"
15
+}
16
+export declare const PEER_MUTED_CHANGED = SignalingEvents.PEER_MUTED_CHANGED;
17
+export declare const PEER_VIDEO_TYPE_CHANGED = SignalingEvents.PEER_VIDEO_TYPE_CHANGED;

正在加载...
取消
保存