Browse Source

feat(ts) TypeScript enum for JitsiConnectionErrors

tags/v0.0.2
Gary Hunt 2 years ago
parent
commit
f7a81e75ef
No account linked to committer's email address
3 changed files with 71 additions and 57 deletions
  1. 0
    32
      JitsiConnectionErrors.js
  2. 40
    0
      JitsiConnectionErrors.ts
  3. 31
    25
      types/auto/JitsiConnectionErrors.d.ts

+ 0
- 32
JitsiConnectionErrors.js View File

@@ -1,32 +0,0 @@
1
-/**
2
- * The errors for the connection.
3
- */
4
-
5
-/**
6
- * Indicates that the connection was dropped with an error which was most likely
7
- * caused by some networking issues. The dropped term in this context means that
8
- * the connection was closed unexpectedly (not on user's request).
9
- *
10
- * One example is 'item-not-found' error thrown by Prosody when the BOSH session
11
- * times out after 60 seconds of inactivity. On the other hand 'item-not-found'
12
- * could also happen when BOSH request is sent to the server with the session-id
13
- * that is not know to the server. But this should not happen in lib-jitsi-meet
14
- * case as long as the service is configured correctly (there is no bug).
15
- */
16
-export const CONNECTION_DROPPED_ERROR = 'connection.droppedError';
17
-
18
-/**
19
- * Not specified errors.
20
- */
21
-export const OTHER_ERROR = 'connection.otherError';
22
-
23
-/**
24
- * Indicates that a password is required in order to join the conference.
25
- */
26
-export const PASSWORD_REQUIRED = 'connection.passwordRequired';
27
-
28
-/**
29
- * Indicates that the connection was dropped, because of too many 5xx HTTP
30
- * errors on BOSH requests.
31
- */
32
-export const SERVER_ERROR = 'connection.serverError';

+ 40
- 0
JitsiConnectionErrors.ts View File

@@ -0,0 +1,40 @@
1
+/**
2
+ * The errors for the connection.
3
+ */
4
+
5
+export enum JitsiConnectionErrors {
6
+    /**
7
+     * Indicates that the connection was dropped with an error which was most likely
8
+     * caused by some networking issues. The dropped term in this context means that
9
+     * the connection was closed unexpectedly (not on user's request).
10
+     *
11
+     * One example is 'item-not-found' error thrown by Prosody when the BOSH session
12
+     * times out after 60 seconds of inactivity. On the other hand 'item-not-found'
13
+     * could also happen when BOSH request is sent to the server with the session-id
14
+     * that is not know to the server. But this should not happen in lib-jitsi-meet
15
+     * case as long as the service is configured correctly (there is no bug).
16
+     */
17
+    CONNECTION_DROPPED_ERROR = 'connection.droppedError',
18
+
19
+    /**
20
+     * Not specified errors.
21
+     */
22
+    OTHER_ERROR = 'connection.otherError',
23
+
24
+    /**
25
+     * Indicates that a password is required in order to join the conference.
26
+     */
27
+    PASSWORD_REQUIRED = 'connection.passwordRequired',
28
+
29
+    /**
30
+     * Indicates that the connection was dropped, because of too many 5xx HTTP
31
+     * errors on BOSH requests.
32
+     */
33
+    SERVER_ERROR = 'connection.serverError'
34
+};
35
+
36
+// exported for backward compatibility
37
+export const CONNECTION_DROPPED_ERROR = JitsiConnectionErrors.CONNECTION_DROPPED_ERROR;
38
+export const OTHER_ERROR = JitsiConnectionErrors.OTHER_ERROR;
39
+export const PASSWORD_REQUIRED = JitsiConnectionErrors.PASSWORD_REQUIRED;
40
+export const SERVER_ERROR = JitsiConnectionErrors.SERVER_ERROR;

+ 31
- 25
types/auto/JitsiConnectionErrors.d.ts View File

@@ -1,28 +1,34 @@
1 1
 /**
2 2
  * The errors for the connection.
3 3
  */
4
-/**
5
- * Indicates that the connection was dropped with an error which was most likely
6
- * caused by some networking issues. The dropped term in this context means that
7
- * the connection was closed unexpectedly (not on user's request).
8
- *
9
- * One example is 'item-not-found' error thrown by Prosody when the BOSH session
10
- * times out after 60 seconds of inactivity. On the other hand 'item-not-found'
11
- * could also happen when BOSH request is sent to the server with the session-id
12
- * that is not know to the server. But this should not happen in lib-jitsi-meet
13
- * case as long as the service is configured correctly (there is no bug).
14
- */
15
-export const CONNECTION_DROPPED_ERROR: "connection.droppedError";
16
-/**
17
- * Not specified errors.
18
- */
19
-export const OTHER_ERROR: "connection.otherError";
20
-/**
21
- * Indicates that a password is required in order to join the conference.
22
- */
23
-export const PASSWORD_REQUIRED: "connection.passwordRequired";
24
-/**
25
- * Indicates that the connection was dropped, because of too many 5xx HTTP
26
- * errors on BOSH requests.
27
- */
28
-export const SERVER_ERROR: "connection.serverError";
4
+export declare enum JitsiConnectionErrors {
5
+    /**
6
+     * Indicates that the connection was dropped with an error which was most likely
7
+     * caused by some networking issues. The dropped term in this context means that
8
+     * the connection was closed unexpectedly (not on user's request).
9
+     *
10
+     * One example is 'item-not-found' error thrown by Prosody when the BOSH session
11
+     * times out after 60 seconds of inactivity. On the other hand 'item-not-found'
12
+     * could also happen when BOSH request is sent to the server with the session-id
13
+     * that is not know to the server. But this should not happen in lib-jitsi-meet
14
+     * case as long as the service is configured correctly (there is no bug).
15
+     */
16
+    CONNECTION_DROPPED_ERROR = "connection.droppedError",
17
+    /**
18
+     * Not specified errors.
19
+     */
20
+    OTHER_ERROR = "connection.otherError",
21
+    /**
22
+     * Indicates that a password is required in order to join the conference.
23
+     */
24
+    PASSWORD_REQUIRED = "connection.passwordRequired",
25
+    /**
26
+     * Indicates that the connection was dropped, because of too many 5xx HTTP
27
+     * errors on BOSH requests.
28
+     */
29
+    SERVER_ERROR = "connection.serverError"
30
+}
31
+export declare const CONNECTION_DROPPED_ERROR = JitsiConnectionErrors.CONNECTION_DROPPED_ERROR;
32
+export declare const OTHER_ERROR = JitsiConnectionErrors.OTHER_ERROR;
33
+export declare const PASSWORD_REQUIRED = JitsiConnectionErrors.PASSWORD_REQUIRED;
34
+export declare const SERVER_ERROR = JitsiConnectionErrors.SERVER_ERROR;

Loading…
Cancel
Save