Files
bilin/src/main/ipc/handlers/pomodoro.handler.ts
T
bing d4122c8f95 feat: ship v0.9.0 with pomodoro, achievements, and injection history
Add pomodoro timer with goal notifications, writing streak milestones, and knowledge injection logging with UI previews across AI writing flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 19:15:52 +08:00

15 lines
692 B
TypeScript

import { ipcMain } from 'electron'
import { IPC } from '../../../shared/ipc-channels'
import type { PomodoroService } from '../../services/pomodoro.service'
import { wrap } from '../result'
export function registerPomodoroHandlers(pomodoro: PomodoroService): void {
ipcMain.handle(IPC.POMODORO_START, (_e, { bookId }: { bookId: string }) =>
wrap(() => pomodoro.start(bookId))
)
ipcMain.handle(IPC.POMODORO_PAUSE, () => wrap(() => pomodoro.pause()))
ipcMain.handle(IPC.POMODORO_RESUME, () => wrap(() => pomodoro.resume()))
ipcMain.handle(IPC.POMODORO_CANCEL, () => wrap(() => pomodoro.cancel()))
ipcMain.handle(IPC.POMODORO_GET_STATE, () => wrap(() => pomodoro.getState()))
}