title: How to exclude a key from an interface in TypeScript
body: <p>In TypeScript, you can combine two interface types like this</p>
  
  <pre><code>interface Foo {
      var1: string
  }
  
  interface Bar {
      var2: string
  }
  
  type Combined = Foo &amp; Bar
  </code></pre>
  
  <p>Instead of combining keys, I want to exclude keys from one interface to another. Is there anyway you can do it in TypeScript?</p>
  
  <p>The reason is, I have an HOC, which manages a property value for other wrapped component like this</p>
  
  <pre><code>export default function valueHOC&lt;P&gt; (
    Comp: React.ComponentClass&lt;P&gt; | React.StatelessComponent&lt;P&gt;
  ): React.ComponentClass&lt;P&gt; {
    return class WrappedComponent extends React.Component&lt;P, State&gt; {
      render () {
        return (
          &lt;Comp
            {...this.props}
            value={this.state.value}
          /&gt;
        )
      }
  }
  </code></pre>
  
  <p>With that I can write</p>
  
  <pre><code>const ValuedComponent = valueHOC(MyComponent)
  </code></pre>
  
  <p>then</p>
  
  <pre><code>&lt;ValuedComponent /&gt;
  </code></pre>
  
  <p>but the problem is, the returned component type is also using the props type from given component, so TypeScript will complain and ask me to provide the <code>value</code> prop. As a result, I will have to write something like</p>
  
  <pre><code>&lt;ValuedComponent value="foo" /&gt;
  </code></pre>
  
  <p>Which the value will not be used anyway. What I want here is to return an interface without specific keys, I want to have something like this</p>
  
  <pre><code>React.ComponentClass&lt;P - {value: string}&gt;
  </code></pre>
  
  <p>Then the <code>value</code> will not be needed in the returned component. Is it possible in TypeScript for now?</p>