diff --git a/react/features/subtitles/middleware.ts b/react/features/subtitles/middleware.ts index 07a29e8a6db..85c8c8b8137 100644 --- a/react/features/subtitles/middleware.ts +++ b/react/features/subtitles/middleware.ts @@ -13,6 +13,7 @@ import { updateTranscriptMessage } from './actions.any'; import { notifyTranscriptionChunkReceived } from './functions'; +import { ITranscriptMessage } from './types'; /** @@ -188,9 +189,8 @@ function _endpointMessageReceived(store: IStore, next: Function, action: AnyActi // message ID or adds a new transcript message if it does not // exist in the map. const existingMessage = state['features/subtitles']._transcriptMessages.get(transcriptMessageID); - const newTranscriptMessage: any = { + const newTranscriptMessage: ITranscriptMessage = { clearTimeOut: existingMessage?.clearTimeOut, - language, participant }; diff --git a/react/features/subtitles/reducer.ts b/react/features/subtitles/reducer.ts index 44e07aeed6c..1a679a14e76 100644 --- a/react/features/subtitles/reducer.ts +++ b/react/features/subtitles/reducer.ts @@ -6,6 +6,7 @@ import { TOGGLE_REQUESTING_SUBTITLES, UPDATE_TRANSCRIPT_MESSAGE } from './actionTypes'; +import { ITranscriptMessage } from './types'; /** * Default State for 'features/transcription' feature. @@ -17,18 +18,11 @@ const defaultState = { _language: null }; -interface ITranscriptMessage { - final: string; - participantName: string; - stable: string; - unstable: string; -} - export interface ISubtitlesState { _displaySubtitles: boolean; _language: string | null; _requestingSubtitles: boolean; - _transcriptMessages: Map | any; + _transcriptMessages: Map; } /** diff --git a/react/features/subtitles/types.ts b/react/features/subtitles/types.ts new file mode 100644 index 00000000000..fe672940371 --- /dev/null +++ b/react/features/subtitles/types.ts @@ -0,0 +1,11 @@ +export interface ITranscriptMessage { + clearTimeOut?: number; + final?: string; + participant: { + avatarUrl?: string; + id?: string; + name?: string; + }; + stable?: string; + unstable?: string; +}