이것이 구현되지 않은 이유는 무엇입니까? 많은 속성을 가진 객체를 만들기 위해 노력하고 있지만, 같은 유형의 객체 모두를 만들려고합니다. 그러나 인터페이스가 작동하지 않습니다. Index sigatures of types 'Foo' and 'StringKey' are incompatible.
typescript 클래스로 구현되지 않은 주요 인터페이스
interface StringKey {
[key: string]: number;
}
class Foo implements StringKey {
public Foo1 = 1;
public Foo2 = 2;
public Foo3 = 3;
constructor() {
}
}
감사합니다. 조금 어색하지만 해결할 것입니다. – Tim