title: How to use TypeScript types on API response data
body: <p>So I make a call to the api and return data form it. It contains way more data than I need, so I map trough my response and return only values that I need. The problem is that I do not understand how to define my response data in TS. Now it looks like this but <strong>I know that using any is a bad option</strong>.</p>
  <pre><code>data = data.results.map((item: any) =&gt; {
                          return {
                              id: item.id,
                              src: item.urls.small,
                              description: item.alt_description,
                              name: item.user.name,
                              favorited: false
                          }
                      })
  </code></pre>
  <p>How should I transform response data to format that I need using TS. I think I need some additional step so I could use my interface on item.</p>
  <pre><code>interface PhotoModel {
      id: string
      src: string
      description: string
      name: string
      favorited: boolean
      }
  </code></pre>