import { GA_NAME, type Events as SharedEvents } from '@nalssigak/shared/lib/analytics' import type { SheetState } from '../b/sheetContext' /** 이벤트 목록은 앱과 같이 쓴다 (shared/lib/analytics.ts, docs/이벤트_추적.md) */ type Events = SharedEvents type SheetType = Exclude['type'] declare global { interface Window { gtag?: (command: 'event', name: string, params: Record) => void } } export function track(event: E, params: Events[E]) { if (import.meta.env.DEV) return window.gtag?.('event', GA_NAME[event], params) }