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

Type member incorrectly shown as any #1788

Closed
srmagura opened this issue Nov 11, 2021 · 5 comments
Closed

Type member incorrectly shown as any #1788

srmagura opened this issue Nov 11, 2021 · 5 comments
Labels
bug Functionality does not match expectation help wanted Contributions are especially encouraged

Comments

@srmagura
Copy link
Contributor

Search terms

any

Expected Behavior

TypeDoc should not show the email member as having type any for the following code:

export type Validators = {
  email: (value: string) => boolean;
};

Actual Behavior

image

Steps to reproduce the bug

  1. Clone https://github.com/srmagura/typedoc-namespace-variable-repro.
  2. yarn install
  3. yarn typedoc

Environment

  • Typedoc version: 0.22.8
  • TypeScript version: 4.4.4
  • Node.js version: 16.13.0
  • OS: Windows 11
@srmagura srmagura added the bug Functionality does not match expectation label Nov 11, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 13, 2021

Wow, that's a weird one... should be an easy fix at least, looks like it's just a rendering issue.

@Gerrit0 Gerrit0 added good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged labels Nov 13, 2021
@aqumus
Copy link
Contributor

aqumus commented Nov 23, 2021

@Gerrit0 Is this issue been worked on by anyone? I could give it a try and raise a PR.
Any initial pointers or fix you might have thought of?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 24, 2021

Not as far as I know - type.tsx is going to be the file you want.

@matteobruni
Copy link
Collaborator

I've searched in the code and the type.tsx file is not handling function parameters here:

{renderType(context, item.type)}

The item.type is undefined, and that's why any appears. But item if it's a function has signatures and each signature has parameters that are not rendered there.

<span class="tsd-signature-symbol">(</span>

Here instead is where the parameters and signatures are handled.

It's not simple for a new contributor to handle this change, I managed the parameters, but I can't find the function return value

@Gerrit0 Gerrit0 removed the good first issue Easier issue for first time contributors label Jan 8, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 8, 2022

Ah, shoot... yeah, that mostly makes sense now... I've never liked ReflectionTypes which is what is responsible for this. Probably going to be an annoying one to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

4 participants