// IPC 通道名常量 — 主进程和渲染进程共享
export const IPC_CHANNELS = {
  // 渲染进程 → 主进程 (invoke)
  DIALOG_OPEN_FILE: 'dialog:openFile',
  FILE_READ: 'file:read',
  FILE_SAVE: 'file:save',
  FILE_SAVE_AS: 'file:saveAs',
  FILE_GET_CURRENT_PATH: 'file:getCurrentPath',
  FILE_STATS: 'file:stats',
  FILE_RELOAD: 'file:reload',
  TAB_SWITCHED: 'tab:switched',
  WINDOW_FORCE_CLOSE: 'window:forceClose',
  WINDOW_CANCEL_CLOSE: 'window:cancelClose',
  DIR_READ_TREE: 'dir:readTree',
  DIR_OPEN_DIALOG: 'dir:openDialog',
  DIR_WATCH: 'dir:watch',
  DIR_UNWATCH: 'dir:unwatch',

  // 主进程 → 渲染进程 (send)
  FILE_OPEN_IN_TAB: 'file:openInTab',
  FILE_EXTERNALLY_MODIFIED: 'file:externallyModified',
  WINDOW_CONFIRM_CLOSE: 'window:confirmClose',
  SIDEBAR_DIR_CHANGED: 'sidebar:dirChanged'
} as const

export type IpcChannel = (typeof IPC_CHANNELS)[keyof typeof IPC_CHANNELS]
