refactor: extract main runtime dependency builders

This commit is contained in:
2026-02-19 23:11:20 -08:00
parent 8c2d82e361
commit 0d7b65ec88
25 changed files with 1490 additions and 262 deletions

View File

@@ -0,0 +1,21 @@
import type { SecondarySubMode } from '../../types';
export function createBuildCycleSecondarySubModeMainDepsHandler(deps: {
getSecondarySubMode: () => SecondarySubMode;
setSecondarySubMode: (mode: SecondarySubMode) => void;
getLastSecondarySubToggleAtMs: () => number;
setLastSecondarySubToggleAtMs: (timestampMs: number) => void;
broadcastToOverlayWindows: (channel: string, mode: SecondarySubMode) => void;
showMpvOsd: (text: string) => void;
}) {
return () => ({
getSecondarySubMode: () => deps.getSecondarySubMode(),
setSecondarySubMode: (mode: SecondarySubMode) => deps.setSecondarySubMode(mode),
getLastSecondarySubToggleAtMs: () => deps.getLastSecondarySubToggleAtMs(),
setLastSecondarySubToggleAtMs: (timestampMs: number) =>
deps.setLastSecondarySubToggleAtMs(timestampMs),
broadcastSecondarySubMode: (mode: SecondarySubMode) =>
deps.broadcastToOverlayWindows('secondary-subtitle:mode', mode),
showMpvOsd: (text: string) => deps.showMpvOsd(text),
});
}