All been done many times, and on almost every occasion found not worthwhile on e-bikes. There just isn't enough mass or speed involved.I'm sure some boffin can make a dynamo that only works on down hill so no extra effort for the riders, even 2 or 3 extra miles for no extra work is worth if you can have it
All energy conversions involve loss, so it's far more efficient to use the kinetic energy in the bike to gain downhill sped wherever possible, often helping one into the next uphill or further along the following flat for a while.
The only e-bike system I know of still available with regen is the BionX rear wheel hub motor. That has rider switching of four power levels and four regenerating levels. That regen is not so much useful for gaining current as for the braking effect that nervous riders who don't like high downhill speed find handy.
.