cb6b4c3731
Co-authored-by: Cursor <cursoragent@cursor.com>
14 lines
536 B
TypeScript
14 lines
536 B
TypeScript
import { ipcMain } from 'electron'
|
|
import { IPC } from '../../../shared/ipc-channels'
|
|
import { ArcService } from '../../services/arc.service'
|
|
import type { BookRegistryService } from '../../services/book-registry'
|
|
import { wrap } from '../result'
|
|
|
|
export function registerArcHandlers(registry: BookRegistryService): void {
|
|
ipcMain.handle(
|
|
IPC.ARC_GET_FOR_CHARACTER,
|
|
(_e, { bookId, settingId }: { bookId: string; settingId: string }) =>
|
|
wrap(() => new ArcService(registry.getDb(bookId)).getForCharacter(settingId))
|
|
)
|
|
}
|