title: Provide a type which has listed fields
body: <p>I write a function with Flow which takes a <code>value</code> of <code>MyType</code> and it uses only the field <code>foo: number</code>:</p>
  <pre class="lang-js prettyprint-override"><code>const a = (value: MyType) =&gt; {
    return value.foo;
  };
  </code></pre>
  <p>However, I want to make <code>MyType</code> work with any type which will have <code>foo: number</code> field, e.g. with such types:</p>
  <pre class="lang-js prettyprint-override"><code>type A = {
    foo: number,
    baz: string,
  };
  
  type B = {
    foo: number,
    bar: number,
  };
  </code></pre>
  <p>How can I define <code>MyType</code>, so it would work with <code>A</code> and <code>B</code>, but also with any other type which has <code>foo: number</code>?</p>
  <p>I tried to do it with <code>$Shape&lt;{ foo: number }&gt;</code>, but it doesn't help, because when I provide <code>value: B</code> Flow starts to throw an error. Also I tried to do that as <code>A | B</code>, but I got the same error and anyway it doesn't cover other cases except <code>A</code> and <code>B</code>. Also I thought about generic types, but it doesn't look like they can help here.</p>