import type { HMSPoll } from '../classes/polls/HMSPoll'; import type { HMSHLSPlayerPlaybackState, HMSHLSPlayerPlaybackCueEventData, HMSHLSPlayerPlaybackFailureEventData, HMSHLSPlayerPlaybackResolutionChangeEventData, HMSHLSPlayerStatsErrorEventData, HMSHLSPlayerStatsUpdateEventData } from '../types'; export type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice; export type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice & HLSPlayerClosedCaptionsSlice; export type HMSInteractivityStore = HMSPollsSlice; export type TrackId = string; export type Resolution = { width: number; height: number; }; export interface HMSViewsSlice { hmsviewsResolutions: Record; setHmsviewsResolutions(trackId: TrackId, resolution: Resolution): void; } export interface HMSHLSPlayerPlaybackCue extends Omit { endDate?: Date; startDate: Date; } export type HMSHLSPlayerCue = HMSHLSPlayerPlaybackCue | undefined; export type HMSHLSPlayerPlaybackError = HMSHLSPlayerPlaybackFailureEventData['error'] | undefined; export type HMSHLSPlayerResolution = HMSHLSPlayerPlaybackResolutionChangeEventData | undefined; export interface HMSHLSPlayerPlaybackSlice { cue: HMSHLSPlayerCue; playbackState: HMSHLSPlayerPlaybackState; resolution: HMSHLSPlayerResolution; error: HMSHLSPlayerPlaybackError; setCue(cue: HMSHLSPlayerPlaybackCue): void; setPlaybackState(playbackState: HMSHLSPlayerPlaybackState): void; setResolution(resolution: HMSHLSPlayerResolution): void; setPlaybackError(error: HMSHLSPlayerPlaybackError): void; resetPlaybackSlice(): void; } export type HMSHLSPlayerStats = HMSHLSPlayerStatsUpdateEventData; export type HMSHLSPlayerStatsError = HMSHLSPlayerStatsErrorEventData | undefined; export interface HMSHLSPlayerStatsSlice { stats: HMSHLSPlayerStats; error: HMSHLSPlayerStatsError | undefined; changeStats(stats: HMSHLSPlayerStats): void; setError(error: HMSHLSPlayerStatsError): void; reset(): void; } export interface HLSPlayerClosedCaptionsSlice { subtitles: string | null; setSubtitles(subtitles: string | null): void; } export type HMSPollsSlice = { polls: Record; setPolls(poll: HMSPoll): void; };