refactor: extract shortcut ui runtime deps

This commit is contained in:
2026-02-10 01:36:27 -08:00
parent a17c2296d5
commit cb93601e16
6 changed files with 246 additions and 28 deletions

View File

@@ -5,14 +5,18 @@ export interface GlobalShortcutConfig {
toggleInvisibleOverlayGlobal: string | null | undefined;
}
export function registerGlobalShortcutsService(options: {
export interface RegisterGlobalShortcutsServiceOptions {
shortcuts: GlobalShortcutConfig;
onToggleVisibleOverlay: () => void;
onToggleInvisibleOverlay: () => void;
onOpenYomitanSettings: () => void;
isDev: boolean;
getMainWindow: () => BrowserWindow | null;
}): void {
}
export function registerGlobalShortcutsService(
options: RegisterGlobalShortcutsServiceOptions,
): void {
const visibleShortcut = options.shortcuts.toggleVisibleOverlayGlobal;
const invisibleShortcut = options.shortcuts.toggleInvisibleOverlayGlobal;
const normalizedVisible = visibleShortcut?.replace(/\s+/g, "").toLowerCase();