Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(plugin-meetings): update tsconfig for plugin-meetings #3663

Open
wants to merge 12 commits into
base: next
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ type AnnotationInfo = {

interface IAnnotationChannel {
// === below is for presenter
acceptRequest: (approval) => undefined | Promise<void>;
declineRequest: (approval) => undefined | Promise<void>;
acceptRequest: (approval: any) => undefined | Promise<void>;
declineRequest: (approval: any) => undefined | Promise<void>;
closeAnnotation: (requestData: RequestData) => undefined | Promise<void>;
// === below is for attendee
approveAnnotation: (requestData: RequestData) => undefined | Promise<void>;
cancelApproveAnnotation: (requestData: RequestData, approval) => undefined | Promise<void>;
cancelApproveAnnotation: (requestData: RequestData, approval: any) => undefined | Promise<void>;
sendStrokeData: (strokeData: StrokeData) => void;
// =====
approvalUrlUpdate: (approvalUrl: string) => void;
Expand Down
41 changes: 20 additions & 21 deletions packages/@webex/plugin-meetings/src/annotation/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import uuid from 'uuid';
// eslint-disable-next-line import/no-extraneous-dependencies
import {WebexPlugin, config} from '@webex/webex-core';
import TriggerProxy from '../common/events/trigger-proxy';

Expand All @@ -24,26 +23,26 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {

private seqNum: number;

hasSubscribedToEvents: boolean;
hasSubscribedToEvents: boolean | undefined;

approvalUrl: string;
locusUrl: string;
deviceUrl: string;
approvalUrl: string | undefined;
locusUrl: string | undefined;
deviceUrl: string | undefined;

/**
* Initializes annotation module
*/
constructor(...args) {
constructor(...args: unknown[]) {
super(...args);
this.seqNum = 1;
}

/**
* Process Stroke Data
* @param {object} data
* @param {Record<string, any>} data
* @returns {void}
*/
private processStrokeMessage(data) {
private processStrokeMessage(data: Record<string, any>) {
const {request} = data;
this.decryptContent(request.value.encryptionKeyUrl, request.value.content).then(
(decryptedContent) => {
Expand All @@ -64,10 +63,10 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {
}

/** bind all events from mercury
* @param {Object} e
* @returns {undefined}
* @param {Record<string, any>} e
* @returns {void}
*/
private eventCommandProcessor(e) {
private eventCommandProcessor(e: Record<string, any>) {
if (
e?.data?.eventType === 'locus.approval_request' &&
e?.data?.approval?.resourceType === ANNOTATION_RESOURCE_TYPE &&
Expand All @@ -89,10 +88,10 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {
}

/** bind all events from llm
* @param {Object} e
* @param {Record<string, any>} e
* @returns {undefined}
*/
private eventDataProcessor(e) {
private eventDataProcessor(e: Record<string, any>) {
switch (e?.data?.relayType) {
case ANNOTATION_RELAY_TYPES.ANNOTATION_CLIENT:
this.processStrokeMessage(e.data);
Expand All @@ -104,7 +103,7 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {

/**
* Listen to websocket messages
* @returns {undefined}
* @returns {void}
*/
private listenToEvents() {
if (!this.hasSubscribedToEvents) {
Expand Down Expand Up @@ -141,10 +140,10 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {

/**
* accept request
* @param {object} approval
* @param {Record<string, any>} approval
* @returns {Promise}
*/
public acceptRequest(approval) {
public acceptRequest(approval: Record<string, any>) {
// @ts-ignore
return this.request({
method: HTTP_VERBS.PUT,
Expand All @@ -161,7 +160,7 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {
* @param {approval} approval
* @returns {Promise}
*/
public declineRequest(approval) {
public declineRequest(approval: Record<string, any>) {
// @ts-ignore
return this.request({
method: HTTP_VERBS.PUT,
Expand All @@ -184,11 +183,11 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {

/**
* cancel approved annotation
* @param {object} requestData
* @param {object} approval
* @param {RequestData} requestData
* @param {Record<string, any>} approval
* @returns {Promise}
*/
public cancelApproveAnnotation(requestData: RequestData, approval) {
public cancelApproveAnnotation(requestData: RequestData, approval: Record<string, any>) {
const body: CommandRequestBody = {
actionType: ANNOTATION_ACTION_TYPE.CANCELED,
resourceType: 'AnnotationOnShare',
Expand All @@ -205,7 +204,7 @@ class AnnotationChannel extends WebexPlugin implements IAnnotationChannel {

/**
* close annotation
* @param {object} requestData
* @param {RequestData} requestData
* @returns {Promise}
*/
public closeAnnotation(requestData: RequestData) {
Expand Down
18 changes: 10 additions & 8 deletions packages/@webex/plugin-meetings/src/breakouts/breakout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const Breakout = WebexPlugin.extend({
* If the breakout has no name, assume it is the main session
* @returns {boolean}
*/
fn() {
return this.sessionType === 'MAIN';
fn(): boolean {
return (this as Record<string, any>).sessionType === 'MAIN';
},
},
},
Expand Down Expand Up @@ -99,7 +99,9 @@ const Breakout = WebexPlugin.extend({
throw new Error('Cannot leave the main session');
}

const mainSession = this.parent.breakouts.filter((breakout) => breakout.isMain)[0];
const mainSession = this.parent.breakouts.filter(
(breakout: Record<string, any>) => breakout.isMain
)[0];

if (!mainSession) {
throw new Error('Cannot leave, no main session found');
Expand Down Expand Up @@ -154,10 +156,10 @@ const Breakout = WebexPlugin.extend({
},
/**
* Parses the participants from the locus object
* @param {Object} locus Locus object
* @param {Record<string, any>} locus Locus object
* @returns {void}
*/
parseRoster(locus) {
parseRoster(locus: Record<string, any>) {
if (!this.members) {
this.initMembers();
}
Expand All @@ -170,11 +172,11 @@ const Breakout = WebexPlugin.extend({

/**
* Broadcast message to this breakout session's participants
* @param {String} message
* @param {Object} options
* @param {string} message
* @param {Record<string, any>} options
* @returns {Promise}
*/
broadcast(message, options) {
broadcast(message: string, options: Record<string, any>) {
return this.breakoutRequest.broadcast({
url: this.url,
message,
Expand Down
9 changes: 4 additions & 5 deletions packages/@webex/plugin-meetings/src/breakouts/events.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// eslint-disable-next-line import/prefer-default-export
import {ClientEvent} from '@webex/internal-plugin-metrics';

const breakoutEvent: {
onBreakoutMoveRequest: (eventInfo: any, submitClientEvent: any) => void;
onBreakoutMoveResponse: (eventInfo: any, submitClientEvent: any) => void;
onBreakoutJoinResponse: (eventInfo: any, submitClientEvent: any) => void;
onBreakoutMoveRequest: (eventInfo: unknown, submitClientEvent: unknown) => void;
onBreakoutMoveResponse: (eventInfo: unknown, submitClientEvent: unknown) => void;
onBreakoutJoinResponse: (eventInfo: unknown, submitClientEvent: unknown) => void;
postMoveCallAnalyzer: (
event: ClientEvent['name'],
eventInfo: any,
eventInfo: unknown,
submitClientEvent: any
) => void;
} = {
Expand Down
Loading
Loading