I am implementing the Typescript Array interface. I wonder if there is any possibility to define the get/set for indexes. For example:
class MyClass<T> implements Array<T> {
[index: number] : T;
// ... other methods
}
Is there a possibility to write in a following way:
class MyClass<T> implements Array<T> {
get [index: number] () : T {
// implementation
}
set [index: number] (value: T) : void {
// implementation
}
// ... other methods
}