You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment if a type is not exported, just the name of the type is included in the typedoc JSON output, effectively making the type opaque.
Suggested Solution
It would be great if typedoc could simply inline these types. I have read #1021 (and related issues) and this request also seems related but perhaps suggests a sensible default behaviour. After all if the type is included the exported interface but not exported itself, it is reasonable to see the members in the generated docs. The behaviour could be behind an option if it could causes issues on some projects.
Apologies if this has been discussed already.
The text was updated successfully, but these errors were encountered:
I also looked at #1657 and typedoc-plugin-missing-exports. In our case we don't want these types included as named types at all. They are convenience types which are an internal detail of our project and not for public consumption. For example:
type DigitalOutputCommand = {
/** the desired value */
setValue: boolean
/** whether this state should override state set by an activity */
override: boolean
}
type DigitalOutputStatus = {
/** the effective value determined by the system */
effectiveValue: boolean
} & DigitalOutputCommand
Including these as full types simply makes navigating the documentation much more cumbersome...
You could probably write a plugin to (mostly...) do this (it would look fairly similar to the missing-exports one, just calling convertType instead of convertSymbol, might be a good option for that plugin...). But it'll die a horrible death as soon as any recursive types show up.
It is still my opinion that libraries ought to be written to make the user's life easier. I would make those types interfaces (so they get their own pages, giving each type its own page is something I want to experiment with someday), and export them. Telling a user that a type that is effectively visible isn't meant to be touched is annoying.
lety: OopsCantImportFromYourLibtry{mightFail()y=getY()mightFail2(y)// can't define this function as using the proper type either}catch(err){if(y){reportNonFatalFailure(y)}else{throwerr}}
Search Terms
inline types
Problem
At the moment if a type is not exported, just the name of the type is included in the typedoc JSON output, effectively making the type opaque.
Suggested Solution
It would be great if typedoc could simply inline these types. I have read #1021 (and related issues) and this request also seems related but perhaps suggests a sensible default behaviour. After all if the type is included the exported interface but not exported itself, it is reasonable to see the members in the generated docs. The behaviour could be behind an option if it could causes issues on some projects.
Apologies if this has been discussed already.
The text was updated successfully, but these errors were encountered: