title: How can I convert a type to a class in typescript?
body: <p>I have a class <code>Client</code> and I want to create a new class <code>UpdateClient</code> but omitting few properties of class <code>Client</code>.</p>
  
  <pre><code>class Client {
      constructor() {
          this.clients = '';
          this.client_secret = '';
      }
      clients: string;
      client_secret: string;
  }
  </code></pre>
  
  <p>I want class <code>UpdateClient</code> to be like this</p>
  
  <pre><code>class UpdateClient {
      constructor() {
          this.clients = '';
      }
      clients: string;
  }
  </code></pre>
  
  <p>Now, I'm sure there will be few approaches in vanilla JS by which I can get the task done, like iterating over all enumerable properties of class <code>client</code>, but I don't want to that. </p>
  
  <p>I want a typescript specific solution. I found <code>Omit</code> type utility and it's working as expected. However, there's a small issue which I'm unable to fix. </p>
  
  <p>This is the whole code snippet</p>
  
  <pre><code>class Client {
      constructor() {
          this.clients = '';
          this.client_secret = '';
      }
      clients: string;
      client_secret: string;
  }
  
  type T = Omit&lt;Client, 'client_secret'&gt;
  </code></pre>
  
  <p>I'm getting a type instead of a class. I want to somehow convert this type <code>T</code> to the class <code>UpdateClient</code> and export it. The exported property needs to be a class because the other module using this one expects a class.</p>
  
  <p>I'm using typescript <code>v3.7.5</code></p>