@@ -37,7 +37,7 @@ import { reflectionTemplate } from "./templates/reflection.js";
37
37
import { typeDeclaration , typeDetails , typeDetailsIfUseful } from "./partials/typeDetails.js" ;
38
38
import { moduleMemberSummary , moduleReflection } from "./partials/moduleReflection.js" ;
39
39
import type { Router } from "../../router.js" ;
40
- import type { NeverIfInternal } from "#utils" ;
40
+ import type { JSX , NeverIfInternal } from "#utils" ;
41
41
42
42
function bind < F , L extends any [ ] , R > ( fn : ( f : F , ...a : L ) => R , first : F ) {
43
43
return ( ...r : L ) => fn ( first , ...r ) ;
@@ -62,6 +62,9 @@ export class DefaultThemeRenderContext {
62
62
63
63
/**
64
64
* Icons available for use within the page.
65
+ * When getting an icon for a reflection, {@link reflectionIcon} should be used so
66
+ * that themes which define multiple icon variants can correctly specify which icon
67
+ * they want to be used.
65
68
*
66
69
* Note: This creates a reference to icons declared by {@link DefaultTheme.icons},
67
70
* to customize icons, that object must be modified instead.
@@ -70,6 +73,13 @@ export class DefaultThemeRenderContext {
70
73
return this . _refIcons ;
71
74
}
72
75
76
+ /**
77
+ * Do not override this method, override {@link DefaultTheme.getReflectionIcon} instead.
78
+ */
79
+ reflectionIcon = ( reflection : Reflection ) : JSX . Element => {
80
+ return this . icons [ this . theme . getReflectionIcon ( reflection ) ] ( ) ;
81
+ } ;
82
+
73
83
get slugger ( ) {
74
84
return this . router . getSlugger ( this . page . model ) ;
75
85
}
0 commit comments