mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 06:22:44 -08:00
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
import {
|
|
createIpcDepsRuntime,
|
|
registerAnkiJimakuIpcRuntime,
|
|
registerIpcHandlers,
|
|
} from '../core/services';
|
|
import { registerAnkiJimakuIpcHandlers } from '../core/services/anki-jimaku-ipc';
|
|
import {
|
|
createAnkiJimakuIpcRuntimeServiceDeps,
|
|
AnkiJimakuIpcRuntimeServiceDepsParams,
|
|
createMainIpcRuntimeServiceDeps,
|
|
MainIpcRuntimeServiceDepsParams,
|
|
createRuntimeOptionsIpcDeps,
|
|
RuntimeOptionsIpcDepsParams,
|
|
} from './dependencies';
|
|
|
|
export interface RegisterIpcRuntimeServicesParams {
|
|
runtimeOptions: RuntimeOptionsIpcDepsParams;
|
|
mainDeps: Omit<MainIpcRuntimeServiceDepsParams, 'setRuntimeOption' | 'cycleRuntimeOption'>;
|
|
ankiJimakuDeps: AnkiJimakuIpcRuntimeServiceDepsParams;
|
|
}
|
|
|
|
export function registerMainIpcRuntimeServices(params: MainIpcRuntimeServiceDepsParams): void {
|
|
registerIpcHandlers(createIpcDepsRuntime(createMainIpcRuntimeServiceDeps(params)));
|
|
}
|
|
|
|
export function registerAnkiJimakuIpcRuntimeServices(
|
|
params: AnkiJimakuIpcRuntimeServiceDepsParams,
|
|
): void {
|
|
registerAnkiJimakuIpcRuntime(
|
|
createAnkiJimakuIpcRuntimeServiceDeps(params),
|
|
registerAnkiJimakuIpcHandlers,
|
|
);
|
|
}
|
|
|
|
export function registerIpcRuntimeServices(params: RegisterIpcRuntimeServicesParams): void {
|
|
const runtimeOptionsIpcDeps = createRuntimeOptionsIpcDeps({
|
|
getRuntimeOptionsManager: params.runtimeOptions.getRuntimeOptionsManager,
|
|
showMpvOsd: params.runtimeOptions.showMpvOsd,
|
|
});
|
|
registerMainIpcRuntimeServices({
|
|
...params.mainDeps,
|
|
setRuntimeOption: runtimeOptionsIpcDeps.setRuntimeOption,
|
|
cycleRuntimeOption: runtimeOptionsIpcDeps.cycleRuntimeOption,
|
|
});
|
|
registerAnkiJimakuIpcRuntimeServices(params.ankiJimakuDeps);
|
|
}
|