.types.ts extension in typescript code example
Example: typescript extension getter
interface A {
testGet: SomeType|null;
}
Object.defineProperty(A.prototype, "testGet", {
get (this: A) {
if(this.something) {
return this.something;
}
return null;
},
enumerable: false,
configurable: true
});