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,25 @@
import type { createAppendToMpvLogHandler, createShowMpvOsdHandler } from './mpv-osd-log';
type AppendToMpvLogMainDeps = Parameters<typeof createAppendToMpvLogHandler>[0];
type ShowMpvOsdMainDeps = Parameters<typeof createShowMpvOsdHandler>[0];
export function createBuildAppendToMpvLogMainDepsHandler(deps: AppendToMpvLogMainDeps) {
return (): AppendToMpvLogMainDeps => ({
logPath: deps.logPath,
dirname: (targetPath: string) => deps.dirname(targetPath),
mkdir: (targetPath: string, options: { recursive: boolean }) => deps.mkdir(targetPath, options),
appendFile: (targetPath: string, data: string, options: { encoding: 'utf8' }) =>
deps.appendFile(targetPath, data, options),
now: () => deps.now(),
});
}
export function createBuildShowMpvOsdMainDepsHandler(deps: ShowMpvOsdMainDeps) {
return (): ShowMpvOsdMainDeps => ({
appendToMpvLog: (message: string) => deps.appendToMpvLog(message),
showMpvOsdRuntime: (mpvClient, text, fallbackLog) =>
deps.showMpvOsdRuntime(mpvClient, text, fallbackLog),
getMpvClient: () => deps.getMpvClient(),
logInfo: (line: string) => deps.logInfo(line),
});
}