Phase 1: - 프로젝트 초기화 (TypeScript strict, electron-vite, ESLint, Prettier) - shared 타입 (ipc-channels 113채널, types, errors, constants) - 메인 프로세스 뼈대 (bootstrap, lifecycle, 단일 인스턴스) - LoggerService, ConfigService (electron-store ESM dynamic import) - React 19 + MUI 7 Dashboard, 시스템 트레이 Phase 2: - AudioCaptureService (node-record-lpcm16, PCM16 16kHz mono) - HotkeyService (uiohook-napi, 더블프레스, holdMode/toggleMode) - LocalSTTService (faster-whisper Python sidecar, 이중 조건 플러시) - VoiceModeService 오케스트레이터 (이중 상태머신, Action Queue) - Python sidecar (FastAPI: health/load/transcribe/shutdown) - IPC 핸들러 (voice, stt, hotkey) + Preload API 확장
31 lines
793 B
TypeScript
31 lines
793 B
TypeScript
// src/main/ipc/window-handlers.ts
|
|
|
|
import { ipcMain } from 'electron'
|
|
import { IPC_CHANNELS } from '@shared/ipc-channels'
|
|
import { ipcSuccess } from '@shared/errors'
|
|
import { getMainWindow } from '../windows/WindowManager'
|
|
|
|
export function registerWindowHandlers(): void {
|
|
ipcMain.on(IPC_CHANNELS.WINDOW.MINIMIZE, () => {
|
|
getMainWindow()?.minimize()
|
|
})
|
|
|
|
ipcMain.on(IPC_CHANNELS.WINDOW.MAXIMIZE, () => {
|
|
const win = getMainWindow()
|
|
if (win) {
|
|
if (win.isMaximized()) {
|
|
win.unmaximize()
|
|
} else {
|
|
win.maximize()
|
|
}
|
|
}
|
|
})
|
|
|
|
ipcMain.on(IPC_CHANNELS.WINDOW.CLOSE, () => {
|
|
getMainWindow()?.close()
|
|
})
|
|
|
|
ipcMain.handle(IPC_CHANNELS.WINDOW.IS_MAXIMIZED, async () => {
|
|
return ipcSuccess(getMainWindow()?.isMaximized() ?? false)
|
|
})
|
|
}
|