import type { AnalyticsUserProperty, AnalyticsUserPropertyValue, AnalyticsEvent, AnalyticsEventData, } from '@/constants/analytics'; export const identify = ( property: T, propertyValue: AnalyticsUserPropertyValue ) => { const customEvent = new CustomEvent('dydx:identify', { detail: { property, propertyValue }, }); globalThis.dispatchEvent(customEvent); }; export const track = ( eventType: T, eventData?: AnalyticsEventData ) => { const customEvent = new CustomEvent('dydx:track', { detail: { eventType, eventData }, }); globalThis.dispatchEvent(customEvent); };