/** * Anti-corruption layer between the bridge runtime and baileyrs domain code. * * Every inbound bridge event flows through `adaptBridgeEvent`, which returns * a strictly-typed `CanonicalEvent` (or `null` when the payload is malformed * past recovery). Downstream code (notably `Socket/events.ts`) consumes the * canonical union exclusively — no `event.data as Whatever` casts, no * defensive optional chains, no implicit knowledge of how serde happens to * serialize a particular rust enum today. * * If the bridge's `.d.ts` and runtime ever drift again (renamed field, * leaked PascalCase variant, ISO timestamp where a number was promised), * the bug surfaces here as one failing fixture test instead of a silent * data lie that propagates through the whole event surface. */ import type { WhatsAppEvent } from 'whatsapp-rust-bridge'; import type { ILogger } from '../Utils/logger.js'; import type { CanonicalEvent } from './types.js'; /** * Every bridge event type the adapter explicitly handles. Source of truth * for drift detection — `dts-drift.test.ts` cross-checks this against the * actual `WhatsAppEvent` union shipped by the bridge's `.d.ts`. Any new * `case` in `adaptBridgeEvent` below must also appear here. */ export declare const KNOWN_BRIDGE_EVENT_TYPES: Set; /** Result is `null` on unrecoverable shape mismatch — caller should drop the event. */ export declare const adaptBridgeEvent: (event: WhatsAppEvent, logger?: ILogger) => CanonicalEvent | null; //# sourceMappingURL=adapt.d.ts.map