title: Is it possible to filter out getters using mapped types in typescript?
body: <p>I want to define a mapped type that excludes <code>get</code> functions from the type that is mapped, however, getters are equivalent to <code>readonly</code> properties in their type signature, so the best I could come up with is this:</p>
  
  <pre class="lang-js prettyprint-override"><code>type IfEquals&lt;X, Y, A, B&gt; =
      (&lt;T&gt;() =&gt; T extends X ? 1 : 2) extends
      (&lt;T&gt;() =&gt; T extends Y ? 1 : 2) ? A : B;
  
  type WithoutGetters&lt;T&gt; = { 
     [P in keyof T]: IfEquals&lt;{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P&gt; 
  };
  </code></pre>
  
  <p>However, this also excludes regular <code>readonly</code> properties, which I <em>do</em> want to include.
  Is it possible to exclude only the <code>get</code> functions and not the rest of the <code>readonly</code> properties? </p>