[idl-generator] Add event handler support

should be `event.type`, will change it