I think the typing should switch from player?: Player to player: Player. This is because some arguments require Player, but the listen method returns Player | undefined which triggers the type system to raise an error. I have to use as keyword to force it to be Player type which is unnecessary. I am pretty sure player argument will return nil on the client side, I don't find any use case for using the nil so making the type from player?: Player to player: Player is more suitable I guess?
before:
listen: (callback: (data: T["value"], player?: Player) => void) => void;
after:
listen: (callback: (data: T["value"], player: Player) => void) => void;