title: how to access nested array type in typescript
body: <p>I want to extract a sub-type from an interface in typescript like below</p>
  <pre><code>interface components {
    schemas: {
      a: {
        b?: Array&lt;{
          c?: {
            d?: string;
          };
        }&gt;;
      };
    }
  // I want to export
  
  export type custom = components[&quot;schemas&quot;][&quot;a&quot;][&quot;b&quot;][number][&quot;c&quot;]
  
  </code></pre>
  <p>however I get an error at <code>[number]</code> saying <code>Type '{ c?: { d?: string | undefined; } | undefined; }[] | undefined' has no matching index signature for type 'number'.ts(2537)</code></p>
  <p>How do we achieve this?</p>