Подскажите как правильно написать тип функции
https://www.typescriptlang.org/play?jsx=0#code/MYewdgzgLgBAJgQygmBeGBtA3ggXARgF8AaGLAI1wCIoBTADyipLOFxigCcBXWwgXQBQggGbcwwKAEtwMAA5JgACwBiU2gBs4EABSJkpANa0AnqQBuCDbwCU7cyClwygmIMLCFUZWs3a9SAikVAhUpAAsNjAA9NGAgiCATCCAfCCAnCBxgEIgyTCArCAZgDIgMID8IIACIIAcIImADCDZCVXpcYDyIDCAvCBJgDwg2cUwgFwgFV0wpTCAjCCA0iCA3CCkSYASIKWDXQNN2emCXj7qWrr6QTBUcGEwkTHRMIC4IIsw6b1JgMwgSTCJqRk1MFMzPcuKqmv+m8GhweFUKKxQCEIMk0plbrl0gUWudSoU7mDHhV+oB2EHaCyaz2mswqwlAkBAGloADoNCAAOYBZA2IA