I am looking to develop an interface that can receive an actual class instead of an instance of the class. Here is a sample code snippet:
class CheckIfGoNextPage{
localResult;
next;
constructor(localResult:string, next:string){
this.localResult = localResult;
this.next = next;
}
}
interface Component{
CheckIfCanGoNext: CheckIfGoNextPage;
}
let x:Component = {"CheckIfCanGoNext": CheckIfGoNextPage}
let f = new x["CheckIfCanGoNext"]("sss", "")
console.log(f.localResult);
If I set CheckIfCanGoNext to any it will work but I will lose the type.