mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-03 18:22:42 -08:00
feat(core): add Electron runtime, services, and app composition
This commit is contained in:
37
src/main/runtime/ipc-runtime-handlers.ts
Normal file
37
src/main/runtime/ipc-runtime-handlers.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { createHandleMpvCommandFromIpcHandler, createRunSubsyncManualFromIpcHandler } from './ipc-bridge-actions';
|
||||
import {
|
||||
createBuildHandleMpvCommandFromIpcMainDepsHandler,
|
||||
createBuildRunSubsyncManualFromIpcMainDepsHandler,
|
||||
} from './ipc-bridge-actions-main-deps';
|
||||
|
||||
type HandleMpvCommandFromIpcMainDeps = Parameters<
|
||||
typeof createBuildHandleMpvCommandFromIpcMainDepsHandler
|
||||
>[0];
|
||||
type RunSubsyncManualFromIpcMainDeps<TRequest, TResult> = Parameters<
|
||||
typeof createBuildRunSubsyncManualFromIpcMainDepsHandler<TRequest, TResult>
|
||||
>[0];
|
||||
|
||||
export function createIpcRuntimeHandlers<TRequest, TResult>(deps: {
|
||||
handleMpvCommandFromIpcDeps: HandleMpvCommandFromIpcMainDeps;
|
||||
runSubsyncManualFromIpcDeps: RunSubsyncManualFromIpcMainDeps<TRequest, TResult>;
|
||||
}) {
|
||||
const handleMpvCommandFromIpcMainDeps = createBuildHandleMpvCommandFromIpcMainDepsHandler(
|
||||
deps.handleMpvCommandFromIpcDeps,
|
||||
)();
|
||||
const handleMpvCommandFromIpc = createHandleMpvCommandFromIpcHandler(
|
||||
handleMpvCommandFromIpcMainDeps,
|
||||
);
|
||||
|
||||
const runSubsyncManualFromIpcMainDeps =
|
||||
createBuildRunSubsyncManualFromIpcMainDepsHandler<TRequest, TResult>(
|
||||
deps.runSubsyncManualFromIpcDeps,
|
||||
)();
|
||||
const runSubsyncManualFromIpc = createRunSubsyncManualFromIpcHandler<TRequest, TResult>(
|
||||
runSubsyncManualFromIpcMainDeps,
|
||||
);
|
||||
|
||||
return {
|
||||
handleMpvCommandFromIpc,
|
||||
runSubsyncManualFromIpc,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user