types.ts41 lines · main
| 1 | import type { Dispatch, ReactNode, SetStateAction } from 'react' |
| 2 | |
| 3 | export interface DevTelemetryEvent { |
| 4 | id: string |
| 5 | timestamp: number |
| 6 | source: 'client' | 'server' |
| 7 | eventType: string |
| 8 | eventName: string |
| 9 | distinctId?: string |
| 10 | properties?: Record<string, unknown> |
| 11 | } |
| 12 | |
| 13 | export interface ServerTelemetryEvent { |
| 14 | id: string |
| 15 | timestamp: number |
| 16 | sessionId: string |
| 17 | eventType: 'capture' | 'identify' | 'groupIdentify' | 'alias' |
| 18 | eventName: string |
| 19 | distinctId: string |
| 20 | properties?: Record<string, unknown> |
| 21 | groups?: Record<string, string | number> |
| 22 | } |
| 23 | |
| 24 | export interface DevToolbarConfig { |
| 25 | apiUrl: string |
| 26 | } |
| 27 | |
| 28 | export interface ExtraTab { |
| 29 | id: string |
| 30 | label: string |
| 31 | content: ReactNode |
| 32 | } |
| 33 | |
| 34 | export interface DevTelemetryToolbarContextType { |
| 35 | isEnabled: boolean |
| 36 | isOpen: boolean |
| 37 | setIsOpen: (open: boolean) => void |
| 38 | events: DevTelemetryEvent[] |
| 39 | setEvents: Dispatch<SetStateAction<DevTelemetryEvent[]>> |
| 40 | dismissToolbar: () => void |
| 41 | } |