Replies: 1 comment 1 reply
-
Ick! These tags were never intended to be combined in any way. Inlined types will not use the converted type from when the type alias is converted, it will convert the type directly there (to handle generic types), so your plugin can't just replace the contents of the type, so listening to TypeDoc does not expose an API for plugins to change how it converts types, and also doesn't expose anything for easily replacing components of types, so doing this in a generic way isn't exactly easy... given that your code likely uses this type as a top level type, however, you can just check the converted types after TypeDoc has converted it. In that case, since this is for a function return type, you want EVENT_CREATE_SIGNATURE (function/method signatures live inside of declarations so that overloads can have multiple cases) In that event, you should check things like your example code already does, but instead of the call to The |
Beta Was this translation helpful? Give feedback.
-
Hello!
In context of #2923 I've got another question that I decided to pull out since I think it can be interesting for others (including people finding this through Google).
Basically, my problem is that I want to combine
@inline
and@interface
.I have a union type like so:
With this I get my desired behavior of
@interface
to discard properties and converting "dynamic" values. However, when I add an@inline
to the code block they are not combined.I suppose it's intended behavior and I'm fine with creating a custom plugin that looks for a custom tag like
@inlineInterface
.I found #2654 and created this so far:
Inside the source code I think I found the code paths I'd want to use:
convertTypeInlined
is getting called whenshouldInline
is true. Which is the case when@inline
modifier tag is setconvertTypeAliasAsInterface
is getting I used (afaik) with@interface
to get my desired behavior of turning "dynamic" unions into one.I'm not quite understanding how I could use
convertTypeAliasAsInterface
in the@inline
codepaths. Is theEVENT_CREATE_DECLARATION
event even the correct event?I'd be super happy if you could give me guidance on putting the pieces together 😊 I don't need the finished plugin necessarily, pseudo-code or instructions on what to use would already be great!
Beta Was this translation helpful? Give feedback.
All reactions