refactor: split preload api by domain

This commit is contained in:
Misaka
2026-03-21 10:49:13 +08:00
parent 26c05f3726
commit ed65312fff
13 changed files with 284 additions and 242 deletions

14
src/preload/api/logger.ts Normal file
View File

@@ -0,0 +1,14 @@
import type { LogLevel } from '../../shared/ipc-channels'
import { IPC_CHANNELS } from '../../shared/ipc-channels'
import { ipcRenderer } from '../lib/ipc'
export const loggerApi = {
log: (level: LogLevel, message: string, context?: Record<string, unknown>): void => {
ipcRenderer.send(IPC_CHANNELS.LOGGER_FORWARD, {
level,
message,
context,
timestamp: Date.now()
})
}
} as const