about TypeScript. See the code below.
interface MyInterface { }
class MyClassA implements MyInterface { }
class MyClassB implements MyInterface { }
const createMyInterface = (_interface: any) => {
return new _interface();
}
createMyInterface(MyClassA);
createMyInterface(MyClassB);
What I want to achieve is that when I call the createMyInterface ()
method, I can clearly indicate that what I need to pass is a definition of implements
class interface MyInterface
interface.
how can I write any
here in _ interface: any
?