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

Opposite of @expand/@inline #2862

Closed
diefbell-grabcad opened this issue Feb 19, 2025 · 1 comment
Closed

Opposite of @expand/@inline #2862

diefbell-grabcad opened this issue Feb 19, 2025 · 1 comment
Milestone

Comments

@diefbell-grabcad
Copy link

diefbell-grabcad commented Feb 19, 2025

Suggestion

There are some places in my documentation where I want to inline a type, but I don't want to inline it everywhere. What would be good is some way to tell Typedoc to expand it only in one place.

One possible suggestion:

type AgeType = {
  age: number;
};

type NameType = {
  name: string;
};

/**
 * @expand {AgeType}
 */
type MyType = AgeType & NameType ;

This would show in docs as:
type MyType = { age: number; } & NameType;

@Gerrit0 Gerrit0 added this to the v0.28.0 milestone Feb 21, 2025
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 21, 2025

This makes sense to allow to me, TypeDoc should probably support a similar @preventInline / @preventExpand as well.

The syntax will have to be somewhat different as @expand and @inline are already declared as a modifier tag, and tags must be of one type. Further, TypeDoc skips type annotations in braces, so I'm leaning towards @inlineType AgeType

@Gerrit0 Gerrit0 modified the milestones: v0.28.0, v0.28.1 Feb 23, 2025
Gerrit0 added a commit that referenced this issue Mar 3, 2025
@Gerrit0 Gerrit0 modified the milestones: v0.28.1, v0.28.0 Mar 9, 2025
Gerrit0 added a commit that referenced this issue Mar 9, 2025
@Gerrit0 Gerrit0 closed this as completed Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants