Skip to content
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

bug: inherited index signatures not being reflected #65

Open
2 tasks done
jordimarimon opened this issue Sep 17, 2022 · 0 comments
Open
2 tasks done

bug: inherited index signatures not being reflected #65

jordimarimon opened this issue Sep 17, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jordimarimon
Copy link
Owner

jordimarimon commented Sep 17, 2022

Prerequisites

Version

N/A

Current Behavior

If an interface A inherits another interface B where the last one has an index signature defined, the reflected interface A doesn't include the index signature defined in the interface B.

Expected Behavior

Inherited index signature should appear in the reflected output

Steps to Reproduce

Sample code:

export interface Foo<T> {
    [index: number]: T;
    field: T;
    method: (a: T) => T;
}

export interface Bar extends Foo<string> {
    childField: number;
}

Sample output:

{
  "name": "Bar",
  "kind": "interface",
  "heritage": [
    {
      "name": "Foo<string>",
      "href": {
        "path": "..."
      },
      "kind": "interface"
    }
  ],
  "members": [
    {
      "name": "field",
      "kind": "field",
      "type": {
        "text": "string"
      },
      "inheritedFrom": "Foo<string>"
    },
    {
      "name": "method",
      "return": {
        "type": {
          "text": "string"
        }
      },
      "parameters": [
        {
          "name": "a",
          "type": {
            "text": "string"
          }
        }
      ],
      "kind": "method",
      "inheritedFrom": "Foo<string>"
    },
    {
      "name": "childField",
      "kind": "field",
      "type": {
        "text": "number"
      }
    }
  ]
}

Code Reproduction URL

No response

Additional Information

No response

@jordimarimon jordimarimon added the bug Something isn't working label Sep 17, 2022
@jordimarimon jordimarimon self-assigned this Sep 17, 2022
@jordimarimon jordimarimon changed the title bug: inherited index signatures not being output bug: inherited index signatures not being reflected Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant