Refractor event types to use a protocol hierarchy?
Currently we have separate, distinct value-types for ClientEvent
, ClientEventWithoutRoomId
, MinimalEvent
, StrippedStateEvent
, and ToDeviceEvent
, which all share some common fields.
If we want to keep events as value-types (otherwise we can just use class-inheritance), should we consider defining these events as protocol types with default implementations using an inheritance hierarchy?
Perhaps as the following:
-
ToDeviceEvent
-> type alias ofMinimalEvent
-
MinimalEvent
-
StrippedStateEvent
-
ClientEventWithoutRoomId
ClientEvent
-
-