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

Types in a namespace with same name as a function type are not documented #2478

Closed
fasttime opened this issue Jan 8, 2024 · 1 comment
Closed
Labels
bug Functionality does not match expectation

Comments

@fasttime
Copy link

fasttime commented Jan 8, 2024

Search terms

namespace, function, const

Expected Behavior

A type declared inside an exported namespace should be documented, even when the namespace shares the name of a function type.

/**
 * Test function
 *
 * @param options Options for the function
 */
declare const test: (options?: test.Options) => void;

declare namespace test {
  /** Test options */
  interface Options {
    a: string;
    b: number;
  }
}

export { test };

Actual Behavior

In the above example, the inner type test.Options is not being documented. I am getting a warning in the terminal:

[warning] test.Options, defined in ./index.ts, is referenced by test.test.options but not included in the documentation.

This seems related to #2476, but still occurs in TypeDoc v0.25.7 when a namespace shares the name of a function type (not a function declaration).

Steps to reproduce the bug

Repro: https://stackblitz.com/edit/stackblitz-starters-qjgazd

For reference, this is the full type declaration file where I originally found this problem: https://github.com/origin-1/c8js/blob/31a262b396c98d95622fcc4b1a31fe04a7d314ea/lib/c8js.d.ts

Environment

  • Typedoc version: 0.25.7
  • TypeScript version: 5.3.3
  • Node.js version: 2.0.10
  • OS:
@fasttime fasttime added the bug Functionality does not match expectation label Jan 8, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 8, 2024

Bah, of course I missed that case... function-variables are handled in a different spot. Should be an easy fix at least

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
Projects
None yet
Development

No branches or pull requests

2 participants