Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
imike57 opened this issue Sep 10, 2024 · 0 comments
Closed

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

imike57 opened this issue Sep 10, 2024 · 0 comments
Assignees
Milestone

Comments

@imike57
Copy link

imike57 commented Sep 10, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants