I want to extend a parameter as follow:
//abstract class and parent structures
interface A{
label_1: string;
}
abstract class A_class{
//...
abstract A_method(p: A): void;
}
then I want a child class with a child parameter
interface B extends A{
label_2: number;
}
class B_class extends A_class{
B_method(p_2: B){ //<-- does not work, it wants me to leave 'A' here.
// I want to inherit properties from A,
// yet I want to add some addtional properties within B
// How would I do this? Is it possible? Is there a better way?
//do stuff with p_2
}
}
I cannot seem to get B_method's parameters to work appropriately. Is there way? or am I just very wrong in my design?
Articles welcome, I have read the TS website already. I may need help understanding something I missed. As a self educated developer, I understand I have holes in my understanding. Please help me fill my missing information in, preferably in a kind way.