mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
14 lines
543 B
TypeScript
14 lines
543 B
TypeScript
import type { AnyPlayerStore, PlayerStore } from '@videojs/core/dom';
|
|
import { type Context, createContext } from '@videojs/element/context';
|
|
|
|
export const PLAYER_CONTEXT_KEY = Symbol('@videojs/player');
|
|
|
|
export type PlayerContextValue<Store extends PlayerStore = AnyPlayerStore> = Store;
|
|
|
|
export type PlayerContext<Store extends PlayerStore = AnyPlayerStore> = Context<
|
|
typeof PLAYER_CONTEXT_KEY,
|
|
PlayerContextValue<Store>
|
|
>;
|
|
|
|
export const playerContext = createContext<PlayerContextValue, typeof PLAYER_CONTEXT_KEY>(PLAYER_CONTEXT_KEY);
|