Files
SubMiner/src/main/ipc-runtime.ts
T
sudacode 7909fcd2cf refactor(ipc): remove dead preload methods and the ASS line broadcast (#293)
Drop 16 overlay preload methods with no caller (onSubtitleAss,
getCurrentSubtitleAss, onVisibility, getOverlayVisibility,
openYomitanSettings, quitApp, toggleOverlay, getMecabStatus,
setMecabEnabled, getKeybindings, saveControllerPreference,
getAnkiConnectStatus, setAnkiConnectEnabled, clearAnkiConnectHistory,
cycleRuntimeOption, appendClipboardVideoToQueue) along with their
IPC_CHANNELS keys, handlers, validators and dep plumbing.

With both ASS consumers gone, stop observing sub-text/ass in mpv and
remove the subtitle-ass-change event chain and appState.currentSubAssText.
The main-process functions these wrapped stay; tray, CLI, shortcuts and
session actions still use them.
2026-10-12 22:11:17 -07:00

46 lines
1.5 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'>;
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,
});
registerAnkiJimakuIpcRuntimeServices(params.ankiJimakuDeps);
}