Add triggerCustomEvent and related types