title: typescript typeof with union or generic
body: <p>I'm new with typescript and try to undertsand how to make type from typeof but there is the problem.</p>
  <p>Lets say i have const <code>filter</code></p>
  <pre><code>export const filter = {
      filters: {
          name: {value: '' , matchMode: ''}
      }
  }
  
  </code></pre>
  <p>Then i make <code>FilterType</code> from <code>const filter</code> using <code>typeof </code></p>
  <pre><code>type FilterType = typeof filter
  
  </code></pre>
  <p>Then i create <code>const myFilter</code> which type is <code>FilterType</code></p>
  <pre><code>export const myFilter: FilterType = {
    filters: {name:{value: 'myValue' , // how to make possible to accept number too?
                   matchMode: 'contains'}} // how to limit matchMode to accept only values 'contain' or 'eq'
  }
  </code></pre>
  <p>Everithing forks fine if keys <code>value</code> and <code>matchMode</code> is a string but it doesn't work if a pass number for example, or i would like predefine <code>matchMode</code> and access only if value is <code>contain</code> or 'eq'</p>
  <p>How could i achieve this? I suppose it could be done with Generic, but how?</p>