Can I inherit one interface into another in typescript? How can I access the property defined in the inherited interface?

I think maybe ICat should extend IMammal because Cat is a Mammal, and a Mammal do not need any references to ICat, think if you want to add IDog one day:

export interface IMammal {
    Description: string;
    HasImage: boolean;   
}

export interface ICat extends IMammal {
    Cateye: string[];
    CatGroup: string[];
    Color: string;    
    Name: string;
}

class Cat implements ICat {
    Cateye: string[];
    Color: string;    
    Name: string;
    Description: string;
    HasImage: boolean;   
    CatGroup: string[];
 }

const pusur:ICat = new Cat();
pusur.Name = "Pusur";
pusur.Description = "Likes lasagna";
pusur.CatGroup = ["Cartoon cat"];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)