Переглянути джерело

feat(ts) TypeScript enum for statistics Events

dev1
Gary Hunt 3 роки тому
джерело
коміт
993e0ba66c
Аккаунт користувача з таким Email не знайдено

+ 0
- 37
service/statistics/Events.js Переглянути файл

@@ -1,37 +0,0 @@
1
-/**
2
- * Notifies about audio level in RTP statistics by SSRC.
3
- *
4
- * @param ssrc - The synchronization source identifier (SSRC) of the
5
- * endpoint/participant whose audio level is being reported.
6
- * @param {number} audioLevel - The audio level of <tt>ssrc</tt> according to
7
- * RTP statistics.
8
- * @param {boolean} isLocal - <tt>true</tt> if <tt>ssrc</tt> identifies the
9
- * local endpoint/participant; otherwise, <tt>false</tt>.
10
- */
11
-export const AUDIO_LEVEL = 'statistics.audioLevel';
12
-
13
-/**
14
- * An event fired just before the statistics module gets disposes and it's
15
- * the last chance to submit some logs that will end up in stats services like
16
- * CallStats (if enabled).
17
- */
18
-export const BEFORE_DISPOSED = 'statistics.before_disposed';
19
-
20
-/**
21
- * An event carrying all statistics by ssrc.
22
- */
23
-export const BYTE_SENT_STATS = 'statistics.byte_sent_stats';
24
-
25
-/**
26
- * An event carrying connection statistics.
27
- *
28
- * @param {object} connectionStats - The connection statistics carried by the
29
- * event such as <tt>bandwidth</tt>, <tt>bitrate</tt>, <tt>packetLoss</tt>,
30
- * <tt>resolution</tt>, and <tt>transport</tt>.
31
- */
32
-export const CONNECTION_STATS = 'statistics.connectionstats';
33
-
34
-/**
35
- * An event carrying performance stats.
36
- */
37
-export const LONG_TASKS_STATS = 'statistics.long_tasks_stats';

+ 46
- 0
service/statistics/Events.ts Переглянути файл

@@ -0,0 +1,46 @@
1
+export enum Events {
2
+    /**
3
+     * Notifies about audio level in RTP statistics by SSRC.
4
+     *
5
+     * @param ssrc - The synchronization source identifier (SSRC) of the
6
+     * endpoint/participant whose audio level is being reported.
7
+     * @param {number} audioLevel - The audio level of <tt>ssrc</tt> according to
8
+     * RTP statistics.
9
+     * @param {boolean} isLocal - <tt>true</tt> if <tt>ssrc</tt> identifies the
10
+     * local endpoint/participant; otherwise, <tt>false</tt>.
11
+     */
12
+    AUDIO_LEVEL = 'statistics.audioLevel',
13
+
14
+    /**
15
+     * An event fired just before the statistics module gets disposes and it's
16
+     * the last chance to submit some logs that will end up in stats services like
17
+     * CallStats (if enabled).
18
+     */
19
+    BEFORE_DISPOSED = 'statistics.before_disposed',
20
+
21
+    /**
22
+     * An event carrying all statistics by ssrc.
23
+     */
24
+    BYTE_SENT_STATS = 'statistics.byte_sent_stats',
25
+
26
+    /**
27
+     * An event carrying connection statistics.
28
+     *
29
+     * @param {object} connectionStats - The connection statistics carried by the
30
+     * event such as <tt>bandwidth</tt>, <tt>bitrate</tt>, <tt>packetLoss</tt>,
31
+     * <tt>resolution</tt>, and <tt>transport</tt>.
32
+     */
33
+    CONNECTION_STATS = 'statistics.connectionstats',
34
+
35
+    /**
36
+     * An event carrying performance stats.
37
+     */
38
+    LONG_TASKS_STATS = 'statistics.long_tasks_stats'
39
+};
40
+
41
+// exported for backward compatibility
42
+export const AUDIO_LEVEL = Events.AUDIO_LEVEL;
43
+export const BEFORE_DISPOSED = Events.BEFORE_DISPOSED;
44
+export const BYTE_SENT_STATS = Events.BYTE_SENT_STATS;
45
+export const CONNECTION_STATS = Events.CONNECTION_STATS;
46
+export const LONG_TASKS_STATS = Events.LONG_TASKS_STATS;

+ 40
- 33
types/auto/service/statistics/Events.d.ts Переглянути файл

@@ -1,33 +1,40 @@
1
-/**
2
- * Notifies about audio level in RTP statistics by SSRC.
3
- *
4
- * @param ssrc - The synchronization source identifier (SSRC) of the
5
- * endpoint/participant whose audio level is being reported.
6
- * @param {number} audioLevel - The audio level of <tt>ssrc</tt> according to
7
- * RTP statistics.
8
- * @param {boolean} isLocal - <tt>true</tt> if <tt>ssrc</tt> identifies the
9
- * local endpoint/participant; otherwise, <tt>false</tt>.
10
- */
11
-export const AUDIO_LEVEL: "statistics.audioLevel";
12
-/**
13
- * An event fired just before the statistics module gets disposes and it's
14
- * the last chance to submit some logs that will end up in stats services like
15
- * CallStats (if enabled).
16
- */
17
-export const BEFORE_DISPOSED: "statistics.before_disposed";
18
-/**
19
- * An event carrying all statistics by ssrc.
20
- */
21
-export const BYTE_SENT_STATS: "statistics.byte_sent_stats";
22
-/**
23
- * An event carrying connection statistics.
24
- *
25
- * @param {object} connectionStats - The connection statistics carried by the
26
- * event such as <tt>bandwidth</tt>, <tt>bitrate</tt>, <tt>packetLoss</tt>,
27
- * <tt>resolution</tt>, and <tt>transport</tt>.
28
- */
29
-export const CONNECTION_STATS: "statistics.connectionstats";
30
-/**
31
- * An event carrying performance stats.
32
- */
33
-export const LONG_TASKS_STATS: "statistics.long_tasks_stats";
1
+export declare enum Events {
2
+    /**
3
+     * Notifies about audio level in RTP statistics by SSRC.
4
+     *
5
+     * @param ssrc - The synchronization source identifier (SSRC) of the
6
+     * endpoint/participant whose audio level is being reported.
7
+     * @param {number} audioLevel - The audio level of <tt>ssrc</tt> according to
8
+     * RTP statistics.
9
+     * @param {boolean} isLocal - <tt>true</tt> if <tt>ssrc</tt> identifies the
10
+     * local endpoint/participant; otherwise, <tt>false</tt>.
11
+     */
12
+    AUDIO_LEVEL = "statistics.audioLevel",
13
+    /**
14
+     * An event fired just before the statistics module gets disposes and it's
15
+     * the last chance to submit some logs that will end up in stats services like
16
+     * CallStats (if enabled).
17
+     */
18
+    BEFORE_DISPOSED = "statistics.before_disposed",
19
+    /**
20
+     * An event carrying all statistics by ssrc.
21
+     */
22
+    BYTE_SENT_STATS = "statistics.byte_sent_stats",
23
+    /**
24
+     * An event carrying connection statistics.
25
+     *
26
+     * @param {object} connectionStats - The connection statistics carried by the
27
+     * event such as <tt>bandwidth</tt>, <tt>bitrate</tt>, <tt>packetLoss</tt>,
28
+     * <tt>resolution</tt>, and <tt>transport</tt>.
29
+     */
30
+    CONNECTION_STATS = "statistics.connectionstats",
31
+    /**
32
+     * An event carrying performance stats.
33
+     */
34
+    LONG_TASKS_STATS = "statistics.long_tasks_stats"
35
+}
36
+export declare const AUDIO_LEVEL = Events.AUDIO_LEVEL;
37
+export declare const BEFORE_DISPOSED = Events.BEFORE_DISPOSED;
38
+export declare const BYTE_SENT_STATS = Events.BYTE_SENT_STATS;
39
+export declare const CONNECTION_STATS = Events.CONNECTION_STATS;
40
+export declare const LONG_TASKS_STATS = Events.LONG_TASKS_STATS;

Завантаження…
Відмінити
Зберегти