I have two subClasses that will be extended to many classes. Now i will find a class with a specific type (in my case this is a property on the subClass).
After creating many instances i have a helper function that will return the first class with a match of needed type. So far everything works fine.
My Problem I do not get the correct ts-type when i return my class on my Helper funtion. I always get a typescript error but i have no idea how to solve that problem.
Is there anyone show me the right way to do it? Or is there some tutorial? (I found some tutorials but only withoud extends and no dynamic store array with many different types)
My example code on the typescript playground with the ts-error