One of my classes is structured like this (only showing a portion here):
export class LinkedListNode<t> extends windward.WrObject implements ILinkedListNode<t> {
public get next(): LinkedListNode<t> {
return this._next === this._list._first ? null : this._next;
}
}
In the interface, I am attempting to declare `next` as a method. However, the following approach does not yield the desired outcome:
export interface ILinkedListNode<t> {
get next(): LinkedListNode<t>;
}
The alternative solution works, but it lacks precision:
export interface ILinkedListNode<t> {
next: LinkedListNode<t>;
}
Is there a way to define a getter within an interface? Getters have distinct characteristics from member variables, such as not being transmitted to a web worker when posting an object.
Thanks - Dave