UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

32 lines (31 loc) 1.32 kB
export interface PlayerContextState<TAction = unknown, TLevel = unknown> { action: TAction; currentState: string; duration: number; currentTime: number; volume: number; playbackRate: number; fullScreen: boolean; levels: Array<TLevel>; url: string; levelMap: Map<string, string>; clarity: string; } export interface PlayerRuntimeState<TPending = unknown> { moveProgress: { percentage: number; mouseDown: boolean; }; isSeeking: boolean; wasPlayingBeforeSeek: boolean; isBuffering: boolean; /** Owned by `core/clarity.ts`, read by `core/seek.ts`/`core/media-dispatch.ts` — a quality-switch reload in flight. */ isSwitchingSource: boolean; pendingPlaybackRestore?: TPending; /** Owned by `core/chrome.ts` — the auto-hide-controller-bar timer. */ controllerBarTimeId?: ReturnType<typeof setTimeout>; } export declare function createDefaultPlayerContext<TAction, TLevel = unknown>(action: TAction): PlayerContextState<TAction, TLevel>; export declare function resetSourceContextState(ctx: PlayerContextState): void; export declare function createDefaultRuntimeState<TPending = unknown>(): PlayerRuntimeState<TPending>; export declare function resetTransientRuntimeState<TPending>(state: PlayerRuntimeState<TPending>): void;