title: TypeScript interface that allows other properties
body: <p>In summary, is it possible to have an interface that declares some base properties, but does not restrict additional properties? This is my current situation:</p>
  
  <p>I'm using the <a href="https://facebook.github.io/flux/" rel="noreferrer">Flux pattern</a>, which defines a generic dispatcher:</p>
  
  <pre><code>class Dispatcher&lt;TPayload&gt; {
      dispatch(arg:TPayload):void { }
  }
  </code></pre>
  
  <p>I then create a dispatcher with my own payload type, like this:</p>
  
  <pre><code>interface ActionPayload {
      actionType: string
  }
  
  const dispatcher = new Dispatcher&lt;ActionPayload&gt;();
  </code></pre>
  
  <p>Now I have some action code that should dispatch a payload with some additional data, but the <code>ActionPayload</code> interface only allows for <code>actionType</code>. In other words, this code:</p>
  
  <pre><code>interface SomePayload extends ActionPayload {
      someOtherData: any
  }
  
  class SomeActions {
      doSomething():void {
          dispatcher.dispatch({
              actionType: "hello",
              someOtherData: {}
          })
      }
  }
  </code></pre>
  
  <p>Gives a compile-error because <code>someOtherData</code> does not match the <code>ActionPayload</code> interface. The issue is that many different "action" classes will re-use the same dispatcher, so while it's <code>someOtherData</code> here it might be <code>anotherKindOfData</code> over there, and so on. At the moment, all I can do to accomodate this is use <code>new Dispatcher&lt;any&gt;()</code> because different actions will be dispatched. All actions share a base <code>ActionPayload</code>, though, so I was hoping to be able to constrain the type like <code>new Dispatcher&lt;extends ActionPayload&gt;()</code> or something. Is something like that possible? </p>