diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ae0c13a2..a5e4176d3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- TypeDoc's `--pretty` option now also controls whether generated HTML contains line breaks, #2287.
- Optimized icon caching to reduce file size in generated HTML documentation, #2287.
+- Render property description of "roughly top level" object types, #2276.
- Added `MarkdownEvent.INCLUDE` for plugins, #2284.
### Bug Fixes
diff --git a/src/lib/output/themes/default/partials/member.declaration.tsx b/src/lib/output/themes/default/partials/member.declaration.tsx
index 360e7c81b..7ed7ce935 100644
--- a/src/lib/output/themes/default/partials/member.declaration.tsx
+++ b/src/lib/output/themes/default/partials/member.declaration.tsx
@@ -1,42 +1,57 @@
-import { DeclarationReflection, ReflectionType } from "../../../../models";
+import type { DeclarationReflection, ReflectionType } from "../../../../models";
import { JSX } from "../../../../utils";
import { getKindClass, hasTypeParameters, renderTypeParametersSignature, wbr } from "../../lib";
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
-export const memberDeclaration = (context: DefaultThemeRenderContext, props: DeclarationReflection) => (
- <>
-
- {wbr(props.name)}
- {renderTypeParametersSignature(context, props.typeParameters)}
- {props.type && (
- <>
- {!!props.flags.isOptional && "?"}:{" "}
- {context.type(props.type)}
- >
- )}
- {!!props.defaultValue && (
- <>
-
- {" = "}
- {props.defaultValue}
-
- >
- )}
-
-
- {context.commentSummary(props)}
-
- {hasTypeParameters(props) && context.typeParameters(props.typeParameters)}
-
- {props.type instanceof ReflectionType && (
+export function memberDeclaration(context: DefaultThemeRenderContext, props: DeclarationReflection) {
+ function renderTypeDeclaration(type: ReflectionType) {
+ return (
Type declaration
- {context.parameter(props.type.declaration)}
+ {context.parameter(type.declaration)}
- )}
+ );
+ }
- {context.commentTags(props)}
+ const visitor = { reflection: renderTypeDeclaration };
- {context.memberSources(props)}
- >
-);
+ return (
+ <>
+
+ {wbr(props.name)}
+ {renderTypeParametersSignature(context, props.typeParameters)}
+ {props.type && (
+ <>
+ {!!props.flags.isOptional && "?"}:{" "}
+ {context.type(props.type)}
+ >
+ )}
+ {!!props.defaultValue && (
+ <>
+
+ {" = "}
+ {props.defaultValue}
+
+ >
+ )}
+
+
+ {context.commentSummary(props)}
+
+ {hasTypeParameters(props) && context.typeParameters(props.typeParameters)}
+
+ {props.type?.visit({
+ reflection: renderTypeDeclaration,
+ array: (arr) => arr.elementType.visit(visitor),
+ intersection: (int) => int.types.map((t) => t.visit(visitor)),
+ union: (union) => union.types.map((t) => t.visit(visitor)),
+ reference: (ref) => ref.typeArguments?.map((t) => t.visit(visitor)),
+ tuple: (ref) => ref.elements.map((t) => t.visit(visitor)),
+ })}
+
+ {context.commentTags(props)}
+
+ {context.memberSources(props)}
+ >
+ );
+}