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 });