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

@inline, @expand, etc. not usable with @typedef #2916

Open
stwlam opened this issue Mar 23, 2025 · 1 comment
Open

@inline, @expand, etc. not usable with @typedef #2916

stwlam opened this issue Mar 23, 2025 · 1 comment
Labels
good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged

Comments

@stwlam
Copy link

stwlam commented Mar 23, 2025

I wasn't sure whether to report this as a bug or feature request since @inline, etc. aren't explicitly marked as supporting @typedef. But since @typedefs are converted to type aliases or interfaces, it seems it should have worked out of the box.

Search terms

inline, expand, typedef

Expected Behavior

The @inline tag may be placed on type aliases and interfaces. When a type is annotated with @inline and the type is referenced, TypeDoc will attempt to inline the referenced type within the other type.

Actual Behavior

The referenced type and type definition itself fall back to any:

Image

Image

Steps to reproduce the bug

/**
 * @typedef HelloProps
 * @inline
 * @property {string} name Name property docs
 */

/**
 * Hello component - HelloProps will be inlined here as
 * if you had written `Hello(props: { name: string })`
 * @param {HelloProps} props
 */
export function hello(props) {
  return "Hello {props.name}!";
}

Moving the placement of @inline to above @typedef or below the @property has it get ignored entirely (perhaps expected).

Environment

  • Typedoc version: 0.28.1
  • TypeScript version: 5.6.3
  • Node.js version: 22.14.0
  • OS: Ubuntu 22.04.5
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 24, 2025

Switching to feature type -- @typedef, despite being converted as a type alias, takes an entirely different code path because it is special and doesn't follow the normal structure that TypeDoc relies on for type aliases. It should be relatively straightforward to add support for @inline.

I'd kind of expect @expand to work already as that tag is used when rendering, at which point TypeDoc has unified both typedef and type aliases into a common reflection structure...

@Gerrit0 Gerrit0 added help wanted Contributions are especially encouraged good first issue Easier issue for first time contributors labels Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

2 participants