Say I have 2 interfaces:
interface Interface1{}
interface Interface2{}
is there a way to declare a property as implementing both interfaces? Something like:
class MyClass{
public p: Interface1, Interface2
}
is there a way to declare a property as implementing both interfaces? Something like:
Yup. An intersection type:
interface Interface1{}
interface Interface2{}
class MyClass{
public p: Interface1 & Interface2
}
interface Interface1 { }
interface Interface2 { }
interface ICombination extends Interface1, Interface2 { };
class MyClass {
public p: ICombination
}