내가 타이프 라이터가 내장 된 인터페이스, ArrayLike
사용하려고 ArrayLike 인터페이스없는,하지만 여전히 다음과 같은 오류 메시지 받고 있습니다 :타이프 라이터 : 인덱스 서명
Error:(12, 11) TS2420: Class 'Point' incorrectly implements interface 'ArrayLike'. Index signature is missing in type 'Point'.
interface ArrayLike<T> {
length: number;
[n: number]: T;
}
class Point implements ArrayLike<number> {
[0]: number = 10;
length: number = 1;
}
가 어떻게이 문제를 해결할 수 있습니까? (또는 다른 해결 방법)
이제 나는 내가 놓친 것을 이해합니다. 고맙습니다! – Gloridea