Ho un'interfaccia TypeScript. Il problema è che ha circa 40 membri. Quando lo uso e implemento solo i membri scelti, ottengo un errore che manca. Come ignorarlo? Devo implementarli tutti? Questo problema mi impedisce di trasmettere un tipo in un altro.Implementare tutti i membri dell'interfaccia
E.g.
interface A {
// 40 members
}
class B implements A {
// only 5 members implemented
}
// somewhere in the code
var myVar1: A = something;
var myVar2: B = <B> myVar1; // here an error (can't convert because B has missing some properties and methods:/)
La regola per le interfacce in tutte le lingue che ho incontrato è che devi implementare tutti i suoi metodi. –