make publishEvent typed