Improve type hints
Merge branch 'cs/#6948-improve-hydrator-type-hints'

Close #6948