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
throws an error if the model isn't specifically a Reflection. It seems like either getUrls() should specifically return a UrlMapping<Reflection>, or Theme should be made generic over the model type.
(My use-case here is adding a generated file to my theme that isn't based on a model at all, but rather on some side-loaded data, so I'd prefer the latter, but I can work around the former.)
The text was updated successfully, but these errors were encountered:
Eventually, I'd like to make the current return type of getUrls truly valid, IIRC it currently uses any due to some variance issues that make UrlMapping<Reflection> non-assignable to UrlMapping<DeclarationReflection>... I've been having too much fun at work lately to want to work much on code stuff on the weekend.
The type annotation for
Theme.getUrls()
is:typedoc/src/lib/output/theme.ts
Line 44 in d4098e8
and
UrlMapping
is:typedoc/src/lib/output/models/UrlMapping.ts
Line 4 in d4098e8
This implies that a theme can return a
UrlContext
with anymodel
value. However, this condition:typedoc/src/lib/output/renderer.ts
Lines 303 to 307 in d4098e8
throws an error if the
model
isn't specifically aReflection
. It seems like eithergetUrls()
should specifically return aUrlMapping<Reflection>
, orTheme
should be made generic over the model type.(My use-case here is adding a generated file to my theme that isn't based on a model at all, but rather on some side-loaded data, so I'd prefer the latter, but I can work around the former.)
The text was updated successfully, but these errors were encountered: