@mega-yfue/eufy-sdk / AnyDeviceEvent
Type Alias: AnyDeviceEvent
ts
type AnyDeviceEvent = { [K in keyof DeviceEventMap]: DeviceEventMap[K] & { eventName: K } }[keyof DeviceEventMap];A single semantic event tagged with its name — the payload of the catch-all "event" listener. A discriminated union over DeviceEventMap, so switching on e.eventName narrows e to that event's payload.
The tag is eventName, not name: an event payload may legitimately carry its own name field, and overwriting it to tag the event would destroy data. Matches the eventName carried on a push event.