diff --git a/CHANGELOG.md b/CHANGELOG.md index 678451a87..efa5b07a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ # Unreleased +## Features + +- Extended reflection preview view for interfaces to include type parameters, #2455. + ### Bug Fixes - Navigation triangle markers should no longer display on a separate line with some font settings, #2457. +- Keyword syntax highlighting introduced in 0.25.4 was not always applied to keywords. ## v0.25.4 (2023-11-26) diff --git a/src/lib/output/themes/default/partials/member.getterSetter.tsx b/src/lib/output/themes/default/partials/member.getterSetter.tsx index 9c3f6bca3..f02aa4bbc 100644 --- a/src/lib/output/themes/default/partials/member.getterSetter.tsx +++ b/src/lib/output/themes/default/partials/member.getterSetter.tsx @@ -16,7 +16,7 @@ export const memberGetterSetter = (context: DefaultThemeRenderContext, props: De {!!props.getSignature && ( <>
  • - get {props.name} + get {props.name} {context.memberSignatureTitle(props.getSignature, { hideName: true, })} @@ -27,7 +27,7 @@ export const memberGetterSetter = (context: DefaultThemeRenderContext, props: De {!!props.setSignature && ( <>
  • - set {props.name} + set {props.name} {context.memberSignatureTitle(props.setSignature, { hideName: true, })} diff --git a/src/lib/output/themes/default/partials/member.signature.title.tsx b/src/lib/output/themes/default/partials/member.signature.title.tsx index ef590ecf8..659e2f0fa 100644 --- a/src/lib/output/themes/default/partials/member.signature.title.tsx +++ b/src/lib/output/themes/default/partials/member.signature.title.tsx @@ -44,8 +44,8 @@ export function memberSignatureTitle( <> {props.kind === ReflectionKind.ConstructorSignature && ( <> - {!!props.flags.isAbstract && abstract } - new + {!!props.flags.isAbstract && abstract } + new )} diff --git a/src/lib/output/themes/default/partials/parameter.tsx b/src/lib/output/themes/default/partials/parameter.tsx index 4fae639f9..be633830a 100644 --- a/src/lib/output/themes/default/partials/parameter.tsx +++ b/src/lib/output/themes/default/partials/parameter.tsx @@ -91,7 +91,7 @@ export const parameter = (context: DefaultThemeRenderContext, props: Declaration
  • {context.reflectionFlags(item.getSignature)} - get + get {wbr(item.name)} (): {context.type(item.getSignature.type)} @@ -108,7 +108,7 @@ export const parameter = (context: DefaultThemeRenderContext, props: Declaration
  • {context.reflectionFlags(item.setSignature)} - set + set {wbr(item.name)} ( {item.setSignature.parameters?.map((item) => ( diff --git a/src/lib/output/themes/default/partials/reflectionPreview.tsx b/src/lib/output/themes/default/partials/reflectionPreview.tsx index 3b5630578..95df3b4f6 100644 --- a/src/lib/output/themes/default/partials/reflectionPreview.tsx +++ b/src/lib/output/themes/default/partials/reflectionPreview.tsx @@ -1,6 +1,6 @@ import { DeclarationReflection, ReflectionKind, type Reflection, ReflectionType } from "../../../../models"; import { JSX } from "../../../../utils"; -import { getKindClass } from "../../lib"; +import { getKindClass, renderTypeParametersSignature } from "../../lib"; import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext"; export function reflectionPreview(context: DefaultThemeRenderContext, props: Reflection) { @@ -12,7 +12,8 @@ export function reflectionPreview(context: DefaultThemeRenderContext, props: Ref return (
    interface - {props.name} + {props.name} + {renderTypeParametersSignature(context, props.typeParameters)}{" "} {context.type(new ReflectionType(props), { topLevelLinks: true })}
    ); diff --git a/src/lib/output/themes/default/partials/typeParameters.tsx b/src/lib/output/themes/default/partials/typeParameters.tsx index b5718d11c..1da7df539 100644 --- a/src/lib/output/themes/default/partials/typeParameters.tsx +++ b/src/lib/output/themes/default/partials/typeParameters.tsx @@ -16,7 +16,7 @@ export function typeParameters(context: DefaultThemeRenderContext, typeParameter {item.name} {!!item.type && ( <> - extends + extends {context.type(item.type)} )} diff --git a/src/lib/output/themes/lib.tsx b/src/lib/output/themes/lib.tsx index 8494ef2a9..1d2c4ae0a 100644 --- a/src/lib/output/themes/lib.tsx +++ b/src/lib/output/themes/lib.tsx @@ -106,7 +106,7 @@ export function renderTypeParametersSignature( {"<"} {join({", "}, typeParameters, (item) => ( <> - {item.flags.isConst && "const "} + {item.flags.isConst && const } {item.varianceModifier ? `${item.varianceModifier} ` : ""} {item.name} @@ -126,7 +126,7 @@ export function renderTypeParametersSignature( {item.name} {!!item.type && ( <> - extends + extends {context.type(item.type)} )} diff --git a/src/lib/serialization/components.ts b/src/lib/serialization/components.ts index 8051b33a7..e73c8003b 100644 --- a/src/lib/serialization/components.ts +++ b/src/lib/serialization/components.ts @@ -10,7 +10,7 @@ import type { ModelToObject } from "./schema"; * Additionally, each {@link Serializer} plugin must define a predicate that instructs the group * it belongs to. */ -export interface SerializerComponent { +export interface SerializerComponent { /** * The priority this serializer should be executed with. * A higher priority means the {@link Serializer} will be applied earlier.