title: Is there a possibility to specify length of array that comes from props?
body: <p>Is it possible to specify the length of the array that comes from <code>props</code> using type from <code>Typescript</code>?</p>
  <p>We have an array of objects:</p>
  <pre><code>const arrayPassedViaProps = [
    { key: '1', label: 'Label 1', value: 9 },
    { key: '2', label: 'Label 2', value: 3 },
    { key: '3', label: 'Label 3', value: 3 },
    { key: '4', label: 'Label 4', value: 22 },
    { key: '5', label: 'Label 5', value: 1 }
  ]
  </code></pre>
  <p>I pass this array as <code>props</code> like this:</p>
  <pre><code>&lt;DownlineProgress data={arrayPassedViaProps} /&gt;
  </code></pre>
  <p>Inside <code>DownlineProgress</code> component I defined a type:</p>
  <pre><code>type DownlineProgressBarProps = {
    data: {
      key: string
      label: string
      value: number
    }[]
  }
  </code></pre>
  <p>I'm using this type with <code>props</code></p>
  <pre><code>export const DownlineProgress = ({data}: DownlineProgressBarProps) =&gt; ... 
  </code></pre>
  <p>I would like to be informed by Typescript when I'm passing props that the array doesn't have the correct length, it should contain TWO or THREE objects</p>
  <p>How I can modify my <code>type</code> to achieve such behavior?</p>
  <p>PS. currently I'm using <code>if</code> statement to check</p>
  <pre><code>if(data.length &gt; 3 || data.length &lt; 2){
    throw(`DownlineProgress need an array of length 2 or 3. You pass ${data.length}`)
  }
  </code></pre>