/** * Runtime-bus → observer translation. * * On hosts where `window.posthog` isn't exposed as a global, the observer's * PostHog auto-attach is a no-op; instead the chat-bar subscribes to the * SYNTRO runtime event bus and forwards events into the observer's allowlist. * * The catch: bus events have already been NORMALIZED by the event-processor * (see `packages/event-processor/src/normalizers/posthog.ts`). The raw PostHog * `$`-prefixed properties `matchEvent` reads (`$event_type`, `$elements`, * `$element_tag_name`, `$pathname`, `$current_url`) were renamed to * (`—dropped—`, `elements`, `tagName`, `pathname`, `url`) and the click/submit * distinction moved from `$event_type` into the normalized event `name` * (`ui.click` / `ui.submit`). This function re-derives the raw shape so * `matchEvent` — the single source of truth, also fed directly by the * `window.posthog`-global path — stays untouched. */ import type { RawEvent } from './allowlist'; /** A normalized event as it arrives on the SYNTRO runtime bus. */ export interface BusEvent { ts?: number; name?: string; source?: string; props?: Record & { originalEvent?: string; }; } /** * Translate one bus event into the `RawEvent` the observer allowlist expects, * or null to drop it. */ export declare function busEventToRawEvent(e: BusEvent): RawEvent | null; //# sourceMappingURL=bus-translate.d.ts.map