Skip to content

Support inlining renamed type aliases in namespaces #3096

@XeroAlpha

Description

@XeroAlpha

Search Terms

inline type alias, replace type, namespace re-export

Problem

When organizing a library's public API using namespaces to re-export types from internal modules (often with renaming), Typedoc treats these as distinct type aliases. This triggers the referenced by ... but not included in the documentation warning for the original source types, cluttering the logs.

Currently, there is no clean way to tell Typedoc: "Treat this alias in the namespace exactly as if it were the original type definition."

Example Scenario:

  1. Source (util.ts):

    export interface Vec { x: number; y: number; }
    export class Vector { /* ... */ }
  2. Public API (index.ts):

    import { Vec as _Vec, Vector as _Vector } from './util.ts';
    
    export namespace Math {
        // I want Math.Vec to be treated exactly as the Vec interface
        export type Vec = _Vec; 
        
        // I want Math.Vector to be treated exactly as the Vector class
        export type Vector = _Vector;
        export const Vector = _Vector;
    }

Current Behavior:
Typedoc generates Math.Vec as a type alias pointing to Vec and emits a warning:

[warning] Vec, defined in util.ts, is referenced by Math.Vec but not included in the documentation.

Attempted Workarounds:

  1. Tags: I have tried using @expand, @expandType, @inline, and @inlineType. None of these effectively replace the alias with the target definition in the generated documentation structure.
  2. Syntax: export import Vec = _Vec; is invalid for types and values in this context (only supports namespaces).

Suggested Solution

I would like to request a feature (either a specific JSDoc tag or a configuration option) that allows replacing the alias/constant with the target definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions