// apps/desktop/src/renderer/utils/format-hotkey.ts // 렌더러가 실행 중인 플랫폼을 알아내는 얇은 어댑터. // // 키 이름 · 수정자 표기 · 결합 규칙의 정본은 @d3ro/core/keybinding 이다 // (formatBindingSegments / joinBindingSegments). 매핑 테이블을 여기에 두지 않는다. import type { BindingPlatform } from '@d3ro/core/keybinding' export type Platform = BindingPlatform export function getPlatform(): Platform { const p = (window as { electronAPI?: { platform?: string } }).electronAPI?.platform if (p === 'darwin' || p === 'win32' || p === 'linux') return p // 폴백: SSR/테스트 환경에서는 navigator.platform로 추정. if (typeof navigator !== 'undefined' && /Mac/i.test(navigator.platform)) return 'darwin' return 'win32' }