W tej chwili TypeScriptnie pozwala na użytkowanie get / zestaw metod (dostępowych) w interfejsach. Na przykład:
interface I {
get name():string;
}
class C implements I {
get name():string {
return null;
}
}
Ponadto, maszynopis nie pozwala na wyrażenie funkcyjne zastosowanie w metodach klasy Array: ex .:
class C {
private _name:string;
get name():string => this._name;
}
Czy istnieje inny sposób mogę użyć getter i setter na definicji interfejsu?













