feat(core): add Electron runtime, services, and app composition

This commit is contained in:
2026-02-22 21:43:43 -08:00
parent 448ce03fd4
commit d3fd47f0ec
562 changed files with 69719 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import type { SubtitlePosition } from '../../types';
export function createBuildMediaRuntimeMainDepsHandler(deps: {
isRemoteMediaPath: (mediaPath: string) => boolean;
loadSubtitlePosition: () => SubtitlePosition | null;
getCurrentMediaPath: () => string | null;
getPendingSubtitlePosition: () => SubtitlePosition | null;
getSubtitlePositionsDir: () => string;
setCurrentMediaPath: (mediaPath: string | null) => void;
clearPendingSubtitlePosition: () => void;
setSubtitlePosition: (position: SubtitlePosition | null) => void;
broadcastToOverlayWindows: (channel: string, payload: unknown) => void;
getCurrentMediaTitle: () => string | null;
setCurrentMediaTitle: (title: string | null) => void;
}) {
return () => ({
isRemoteMediaPath: (mediaPath: string) => deps.isRemoteMediaPath(mediaPath),
loadSubtitlePosition: () => deps.loadSubtitlePosition(),
getCurrentMediaPath: () => deps.getCurrentMediaPath(),
getPendingSubtitlePosition: () => deps.getPendingSubtitlePosition(),
getSubtitlePositionsDir: () => deps.getSubtitlePositionsDir(),
setCurrentMediaPath: (nextPath: string | null) => deps.setCurrentMediaPath(nextPath),
clearPendingSubtitlePosition: () => deps.clearPendingSubtitlePosition(),
setSubtitlePosition: (position: SubtitlePosition | null) => deps.setSubtitlePosition(position),
broadcastSubtitlePosition: (position: SubtitlePosition | null) =>
deps.broadcastToOverlayWindows('subtitle-position:set', position),
getCurrentMediaTitle: () => deps.getCurrentMediaTitle(),
setCurrentMediaTitle: (title: string | null) => deps.setCurrentMediaTitle(title),
});
}