A function that handles the player's source state is written on its
own and passed to on later. EventPayload gives its parameter the
type of that event's data.
const showRate = (s: EventPayload<"source.state">) => void plugin.osd.show("{}×", [s.rate]);
plugin.player.on("source.state", showRate);
The data of event
E, as the listener of Player.on gets it.