Skip to content
New issue

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

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

Already on GitHub? # to your account

Inner types in a function-namespace are not documented #2476

Closed
fasttime opened this issue Jan 5, 2024 · 2 comments
Closed

Inner types in a function-namespace are not documented #2476

fasttime opened this issue Jan 5, 2024 · 2 comments

Comments

@fasttime
Copy link

fasttime commented Jan 5, 2024

Search terms

function, namespace

Expected Behavior

I would expect TypeDoc v0.25.5/6 to behave like v0.25.4.

In the following code, both the function-namespace (test) and the inner type (test.Options) should be documented.

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

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

export { test };

Actual Behavior

Only the function-namespace (test) is documented.

On the command line I see this warning:

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

I can work around this problem by adding a second export keyword directly on the namespace declaration (see below), but that should not be necessary.

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

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

export { test };

Steps to reproduce the bug

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

Environment

  • Typedoc version: 0.25.5 and 0.25.6
  • TypeScript version: 5.3.3
  • Node.js version: 20.10
  • OS: -
@fasttime fasttime added the bug Functionality does not match expectation label Jan 5, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 8, 2024

Well, that's annoying, apparently the symbol flags for namespaces don't mean what I thought they did.. this case shouldn't be caught by the change for #2461.

@Gerrit0 Gerrit0 closed this as completed in 7b558b0 Jan 8, 2024
@fasttime
Copy link
Author

fasttime commented Jan 8, 2024

Thanks! The documentation for function-namespaces is working for me in v0.25.7. Now I'm experiencing another seemingly related problem. I'm going to open a separate issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants