Такое подойдет ?
https://www.typescriptlang.org/play/index.html?jsx=2&ssl=21&ssc=57&pln=21&pc=87#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wChRJZFiYARAeQFk5tcCj0YBaAE1zIrR4AbzhoAzuIA0cAGIAbFDBhIAdgGUK8pAElVKqJEUxgEVXAC+LHHnziYAT208uaXJFVqY4sqTer7OBRVUCVTVQBhAFd7XHVHbTgAXjhhUjg4HHl5YFUALjFJAAN0jLgAI3QAawBzHCjVHgKAYgAGVrQADgBWAEYAblKMt3loFswJwYyiqVKALwhcAolxErKK6rqIBqa4No6egaGxCFGoccnSmdIrFHETgJhSPzNA+KckCPczL2S4AApRGgYjA4gkkJYCkCQWCPgUFEoVBotLp9EhDKcwmZLABKZIAPlSpSIMCiUHMyE4ADo0BwVABRbQgLz-fA8YAAN3wMlUUWyMmBsRA720OJuz38gS+4B++j+gLgqhQzMhqUVyqQBUIpxyqnwcAAPgQFvxDXAdkhMLkkDxcQSicNXvBBaDheC-kqVQAyL1BEIgLGRGFuj4AbU9SAAusSkKTydRqbTUAymSzjmzOdzjrz+cdKRgaXSkIykMz9P8RZ9vp59DJoULKwVgqETGZog3wVSsrrLDy+fIcbMMmKLM983QmF21Dx0f9SuPC8ni6ny9KPF46+rmVru7l9RY+9lB6U+MCyzAqTVYyXzwAhBw6HisnAQGD4Y9ioA