Browse Source

feat(TS) migrate IceFailedHandling to TS (#2663)

dev0
Naman 9 months ago
parent
commit
719b7d60bd
No account linked to committer's email address
1 changed files with 11 additions and 4 deletions
  1. 11
    4
      modules/connectivity/IceFailedHandling.ts

modules/connectivity/IceFailedHandling.js → modules/connectivity/IceFailedHandling.ts View File

@@ -2,6 +2,7 @@ import { getLogger } from '@jitsi/logger';
2 2
 
3 3
 import * as JitsiConferenceErrors from '../../JitsiConferenceErrors';
4 4
 import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
5
+import JitsiConference from '../../JitsiConference';
5 6
 
6 7
 const logger = getLogger(__filename);
7 8
 
@@ -14,11 +15,15 @@ const logger = getLogger(__filename);
14 15
  * 'enableForcedReload' option is set in config.js, the conference will be forcefully reloaded.
15 16
  */
16 17
 export default class IceFailedHandling {
18
+    private _conference: JitsiConference;
19
+    private _canceled: boolean = false;
20
+    private _iceFailedTimeout?: number;
21
+
17 22
     /**
18 23
      * Creates new {@code DelayedIceFailed} task.
19 24
      * @param {JitsiConference} conference
20 25
      */
21
-    constructor(conference) {
26
+    constructor(conference:JitsiConference) {
22 27
         this._conference = conference;
23 28
     }
24 29
 
@@ -28,7 +33,7 @@ export default class IceFailedHandling {
28 33
      * @private
29 34
      * @returns {void}
30 35
      */
31
-    _actOnIceFailed() {
36
+    _actOnIceFailed(): void {
32 37
         if (!this._conference.room) {
33 38
             return;
34 39
         }
@@ -66,8 +71,9 @@ export default class IceFailedHandling {
66 71
 
67 72
     /**
68 73
      * Starts the task.
74
+     * @returns {void}
69 75
      */
70
-    start() {
76
+    start(): void {
71 77
         //  Using xmpp.ping allows to handle both XMPP being disconnected and internet offline cases. The ping function
72 78
         // uses sendIQ2 method which is resilient to XMPP connection disconnected state and will patiently wait until it
73 79
         // gets reconnected.
@@ -93,8 +99,9 @@ export default class IceFailedHandling {
93 99
 
94 100
     /**
95 101
      * Cancels the task.
102
+     * @returns {void}
96 103
      */
97
-    cancel() {
104
+    cancel(): void {
98 105
         this._canceled = true;
99 106
         window.clearTimeout(this._iceFailedTimeout);
100 107
     }

Loading…
Cancel
Save