인스턴트말고 클래스 자체를 타입으로 넣을때


추상클래스를 구현한 아무 클래스를 타입으로 명시하려면 어떻게 해야됨?


가령,


abstract class Cat{}

class AnnoyingCat extends Cat{}

class CuteCat extends Cat{}


function getCat: ????? (){

return Math.random()>0.5 ? AnnoyingCat CuteCat;

}


const catCreator:????? = getCat();

new catCreator().nyan();


요런 구문이 있을때 getCat 리턴타입을 단순히 typeof Cat으로 넣으니깐


구현할때 추상클래스의 인스턴스를 만들 수 없다고 오류가 뜨네..