Skip to content

Commit

Permalink
ref(browser-detection) Convert to TS.
Browse files Browse the repository at this point in the history
  • Loading branch information
jallamsetty1 committed Jul 30, 2024
1 parent d90533e commit 664ee6f
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 116 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BrowserDetection from '../browser-detection/BrowserDetection.js';
import BrowserDetection from '../browser-detection/BrowserDetection';

// TODO: Move BrowserCapabilities from lib-jitsi-meet here and use the JSON
// format for them.
Expand All @@ -7,6 +7,7 @@ import BrowserDetection from '../browser-detection/BrowserDetection.js';
* Implements browser capabilities for lib-jitsi-meet.
*/
export default class BrowserCapabilities {
private _capabilities: { isSupported: boolean; };
/**
* Creates new BrowserCapabilities instance.
*
Expand All @@ -17,7 +18,7 @@ export default class BrowserCapabilities {
* @param {string} browserInfo.name - The name of the browser.
* @param {string} browserInfo.version - The version of the browser.
*/
constructor(capabilitiesDB = {}, isUsingIFrame = false, browserInfo) {
constructor(capabilitiesDB: object = {}, isUsingIFrame: boolean = false, browserInfo: { name: string; version: string; }) {
const browser = new BrowserDetection(browserInfo);
let capabilitiesByVersion;

Expand Down Expand Up @@ -71,7 +72,7 @@ export default class BrowserCapabilities {
*
* @returns {boolean}
*/
isSupported() {
isSupported(): boolean {
return this._capabilities.isSupported;
}

Expand All @@ -80,7 +81,7 @@ export default class BrowserCapabilities {
*
* @returns {boolean}
*/
supportsAudioIn() {
supportsAudioIn(): boolean {
return this._capabilities.audioIn || false;
}

Expand All @@ -89,7 +90,7 @@ export default class BrowserCapabilities {
*
* @returns {boolean}
*/
supportsAudioOut() {
supportsAudioOut(): boolean {
return this._capabilities.audioOut || false;
}

Expand All @@ -99,7 +100,7 @@ export default class BrowserCapabilities {
*
* @returns {boolean}
*/
supportsScreenSharing() {
supportsScreenSharing(): boolean {
return this._capabilities.screenSharing || false;
}

Expand All @@ -108,7 +109,7 @@ export default class BrowserCapabilities {
*
* @returns {boolean}
*/
supportsVideoIn() {
supportsVideoIn(): boolean {
return this._capabilities.videoIn || false;
}

Expand Down
2 changes: 1 addition & 1 deletion browser-capabilities/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as BrowserCapabilities } from './BrowserCapabilities.js';
export { default as BrowserCapabilities } from './BrowserCapabilities.ts';
Loading

0 comments on commit 664ee6f

Please sign in to comment.