Вот такое сделал, в принципе можно и так использовать пока
https://www.typescriptlang.org/play?ts=4.7.2#code/JYWwDg9gTgLgBAVwcAJnAZlCI4HImq4DcAsAFAwCeYApnAGIIB2AxnALxwAUYAhpQBsIvFAC44AUQBuNJjADauPoOEpcAXQCUHAHxwpEVKTLkqtSTLkBnDt0U1LMAIy4ANHADeYLGCfirMFDATADmAL7qcAA+cPaOAExucAFBoVqm1HTSsvCcHuRwhXBmNOK4DjkurgVFykIi4vlkRS1w3hC+-oHBITWFYeRh0Z59xZllFXKJ1c21-PViyd2hg8NNLSUTjgDMbqN1qo2jLe1g8eJMCCAARjRQowNkjxnmAPLoAKpMwBBMADwAFTgNAAHjBZCgbB5NktUuE9HlRvIAApwYJwAGKEoadRHWatMa0cTI4wEwosXgCATXXgsADW4h480OkjBUFpMEB7mh4zgyLCelB4KYkM8BwaaKY6DuGIBQwA-LK4BcKlBtOw9AZUA9Bi86F8fkwbJx3gbfn9snIdMYSnAAMKU6m0ulmo22V02IUQmwAJRoLGgKD+KR67mC0qgGL0iqBKpkUGM5HQzBYMENyQQ1y4PNo7gpVJp9LC4gdBedHu0TV1JjIVkz2dGMPKOz2+Lg+ad9PEUkpun0lMGmnIw7IQA