How to properly type a function that is mapped back through several other objects

visit shbcf.ru