refactor: extract main runtime lifecycle helper builders

This commit is contained in:
2026-02-19 19:57:18 -08:00
parent c9605345bb
commit 45c326db6d
17 changed files with 1249 additions and 247 deletions

View File

@@ -0,0 +1,21 @@
import type { MpvCommandFromIpcRuntimeDeps } from '../ipc-mpv-command';
export function createHandleMpvCommandFromIpcHandler(deps: {
handleMpvCommandFromIpcRuntime: (
command: (string | number)[],
options: MpvCommandFromIpcRuntimeDeps,
) => void;
buildMpvCommandDeps: () => MpvCommandFromIpcRuntimeDeps;
}) {
return (command: (string | number)[]): void => {
deps.handleMpvCommandFromIpcRuntime(command, deps.buildMpvCommandDeps());
};
}
export function createRunSubsyncManualFromIpcHandler<TRequest, TResult>(deps: {
runManualFromIpc: (request: TRequest) => Promise<TResult>;
}) {
return async (request: TRequest): Promise<TResult> => {
return deps.runManualFromIpc(request);
};
}