Describe the problem
Hi. I want to be able to narrow down WebhookEvent type based on what event i received so that i can strictly let my event handlers know what to expect.
Currently there is no way of narrowing down WebhookEvent type for example to only include properties associated with 'egress_ended' event.
Describe the proposed solution
I would love it if i was able to narrow down WebhookEvent like below:
if(event.event==="egress_ended"){
console.log(event.track) // This should throw error in build
}
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response