title: How do I specify a return type for my typed DataStore wrapper function?
body: <p>I'm having trouble figuring out what the return type should be for my AWS Amplify DataStore <code>observeQuery</code> wrapper function. I have</p>
  <pre class="lang-js prettyprint-override"><code>import { DataStore } from 'aws-amplify'
  import type { ProducerModelPredicate } from '@aws-amplify/datastore'
  import { TestData } from 'models'
  
  // Configure DataStore etc. ...
  
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
  export const observeTests = (
      description: string,
      criteria?: ProducerModelPredicate&lt;TestData&gt;,
  ) =&gt; {
      const observedQuery = DataStore.observeQuery( TestData, criteria )
      observedQuery.subscribe( ( snapshot ) =&gt; {
          // some custom things ...
      } )
      return observedQuery
  }
  </code></pre>
  <p>which works fine, but our ESLint requirement for an explicit return type is causing a lot of frustration.</p>
  <p>I've tried both</p>
  <pre class="lang-js prettyprint-override"><code>Observable&lt;DataStoreSnapshot&lt;TestData&gt;&gt;
  </code></pre>
  <p>and</p>
  <pre class="lang-js prettyprint-override"><code> ReturnType&lt;typeof DataStore.observeQuery&lt;TestData&gt;&gt;
  </code></pre>
  <p>But the former requires some deep digging to find the definition of <code>Observable</code> (I haven't found it) and the latter is just (unexpectedly?) wrong.</p>
  <p>How can I correctly specify a return type for this function?</p>