openreplay/frontend/app/components/Session/playerContext.ts
2023-01-13 17:36:35 +01:00

24 lines
545 B
TypeScript

import { createContext } from 'react';
import {
IWebPlayer,
IWebPlayerStore,
IWebLivePlayer,
IWebLivePlayerStore,
} from 'Player'
export interface IPlayerContext {
player: IWebPlayer
store: IWebPlayerStore,
}
export interface ILivePlayerContext {
player: IWebLivePlayer
store: IWebLivePlayerStore
}
type ContextType =
| IPlayerContext
| ILivePlayerContext
export const defaultContextValue = { player: undefined, store: undefined}
// @ts-ignore
export const PlayerContext = createContext<ContextType>(defaultContextValue);