Skip to content

Commit

Permalink
feat(ts) TypeScript enum for JingleSessionState
Browse files Browse the repository at this point in the history
  • Loading branch information
garyhuntddn authored Feb 25, 2022
1 parent f881b3c commit 1935342
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 43 deletions.
22 changes: 0 additions & 22 deletions modules/xmpp/JingleSessionState.js

This file was deleted.

24 changes: 24 additions & 0 deletions modules/xmpp/JingleSessionState.ts
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion types/auto/modules/xmpp/JingleSession.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
40 changes: 20 additions & 20 deletions types/auto/modules/xmpp/JingleSessionState.d.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 1935342

Please sign in to comment.