Skip to content

[BUG] Support for Indexed Access Types ([])  #1507

Closed

Description

@imike57

Hello,

I am experiencing an issue with Compodoc (version 1.1.25) when using indexed access types (also known as lookup types) in TypeScript, specifically when referencing a property of another type or interface using the T[K] syntax.

Example Code

Here is a TypeScript code example that causes this problem:

interface Person {
  name: string;
  age: number;
  phone: number | string;
  email: string;
}

interface ContactInfo {
  phone: Person['phone'];  
  years: Person['age']; 
}

Observed Behavior

When running Compodoc, the types defined using the T[K] syntax are not correctly interpreted or documented. They are not displayed correctly in the generated documentation and empty in JSON export.

Expected Behavior

I would expect Compodoc to recognize and correctly document the types obtained via the [] operator, specifying the exact type (string, number, etc.) instead of an empty result.

Environment Details

  • Compodoc Version: 1.1.25

Thank you for looking into this issue!

Activity

  1. added this to the 1.1.26 milestone on Sep 19, 2024
  2. added 4 commits that reference this issue on Sep 20, 2024
    b7d4eed
    72f090e
    e2c4f69
    31d4f23
  3. added a commit that references this issue on Sep 23, 2024
    8831596
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions