diff --git a/modules/xmpp/JingleSessionState.js b/modules/xmpp/JingleSessionState.js deleted file mode 100644 index 64bc27c9b8..0000000000 --- a/modules/xmpp/JingleSessionState.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * The pending Jingle session state which means the session as defined in - * XEP-0166(before 'session-invite/session-accept' took place). - * - * @type {string} - */ -export const PENDING = 'pending'; - -/** - * The active Jingle session state as defined in XEP-0166 - * (after 'session-invite'/'session-accept'). - * - * @type {string} - */ -export const ACTIVE = 'active'; - -/** - * The ended Jingle session state as defined in XEP-0166 - * (after 'session-terminate'). - * @type {string} - */ -export const ENDED = 'ended'; diff --git a/modules/xmpp/JingleSessionState.ts b/modules/xmpp/JingleSessionState.ts new file mode 100644 index 0000000000..85af2e18d5 --- /dev/null +++ b/modules/xmpp/JingleSessionState.ts @@ -0,0 +1,24 @@ +export enum JingleSessionState { + /** + * The pending Jingle session state which means the session as defined in + * XEP-0166(before 'session-invite/session-accept' took place). + */ + PENDING = 'pending', + + /** + * The active Jingle session state as defined in XEP-0166 + * (after 'session-invite'/'session-accept'). + */ + ACTIVE = 'active', + + /** + * The ended Jingle session state as defined in XEP-0166 + * (after 'session-terminate'). + */ + ENDED = 'ended' +}; + +// exported for backward compatibility +export const PENDING = JingleSessionState.PENDING; +export const ACTIVE = JingleSessionState.ACTIVE; +export const ENDED = JingleSessionState.ENDED; diff --git a/types/auto/modules/xmpp/JingleSession.d.ts b/types/auto/modules/xmpp/JingleSession.d.ts index e519b399d6..613201a6a9 100644 --- a/types/auto/modules/xmpp/JingleSession.d.ts +++ b/types/auto/modules/xmpp/JingleSession.d.ts @@ -51,7 +51,7 @@ export default class JingleSession extends Listenable { * Jingle session state - uninitialized until {@link initialize} is * called @type {JingleSessionState} */ - state: string; + state: JingleSessionState.JingleSessionState; /** * The RTC service instance * @type {RTC} diff --git a/types/auto/modules/xmpp/JingleSessionState.d.ts b/types/auto/modules/xmpp/JingleSessionState.d.ts index bf94446e5e..9b8863ebed 100644 --- a/types/auto/modules/xmpp/JingleSessionState.d.ts +++ b/types/auto/modules/xmpp/JingleSessionState.d.ts @@ -1,20 +1,20 @@ -/** - * The pending Jingle session state which means the session as defined in - * XEP-0166(before 'session-invite/session-accept' took place). - * - * @type {string} - */ -export const PENDING: string; -/** - * The active Jingle session state as defined in XEP-0166 - * (after 'session-invite'/'session-accept'). - * - * @type {string} - */ -export const ACTIVE: string; -/** - * The ended Jingle session state as defined in XEP-0166 - * (after 'session-terminate'). - * @type {string} - */ -export const ENDED: string; +export declare enum JingleSessionState { + /** + * The pending Jingle session state which means the session as defined in + * XEP-0166(before 'session-invite/session-accept' took place). + */ + PENDING = "pending", + /** + * The active Jingle session state as defined in XEP-0166 + * (after 'session-invite'/'session-accept'). + */ + ACTIVE = "active", + /** + * The ended Jingle session state as defined in XEP-0166 + * (after 'session-terminate'). + */ + ENDED = "ended" +} +export declare const PENDING = JingleSessionState.PENDING; +export declare const ACTIVE = JingleSessionState.ACTIVE; +export declare const ENDED = JingleSessionState.ENDED;