I have to create a shape interface that has four field three numbers and a view I think i can do this with two interfaces and extending the one ,the view i need to be able to be undefined as all shapes dont always have a view. The view itself has properties indexShape , height , and moveToFront . Since every shape is not displayed on every level, the view may be undefined I have the below code but i am unsure if this is the correct way?? any help would be appreciated new to typescript
interface view{
indexShape?:any;
height?:number;
moveToFront?:any;
}
interface shape extends view{
numerator: number;
denominator: number;
dropZone: number;
};
viewcan be inheritted to more than oneshapeinterface. If not, I'd suggestIShape { view?: view; ... }. Also note I infront of interface name. That is a good convention. So it should beinterface IShape extends IView