Skip to content

Commit dea5e8e

Browse files
committed
update logic for hiding methods section
1 parent 0c3d485 commit dea5e8e

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

.typedoc/custom-theme.mjs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,25 +238,15 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
238238
const customizedModel = model;
239239
customizedModel.typeParameters = undefined;
240240

241-
// Extract the Accessors group (if any) and prevent default rendering for it
242241
const originalGroups = customizedModel.groups;
243242

244-
const experimentalGroups = originalGroups?.find(g =>
245-
g?.owningReflection?.comment?.modifierTags.has('@experimental'),
246-
);
247-
248-
if (experimentalGroups) {
249-
const groupsWithoutMethods = originalGroups?.filter(g => g.title === 'Properties');
250-
251-
customizedModel.groups = groupsWithoutMethods;
252-
const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options);
253-
customizedModel.groups = originalGroups;
243+
// When an interface extends another interface, typedoc will generate a "Methods" group
244+
// We want to hide this group from being rendered
245+
const groupsWithoutMethods = originalGroups?.filter(g => g.title !== 'Methods');
254246

255-
return nonAccessorOutput;
256-
}
257-
258-
const accessorsGroup = originalGroups?.find(g => g.title === 'Accessors');
259-
const groupsWithoutAccessors = originalGroups?.filter(g => g.title !== 'Accessors');
247+
// Extract the Accessors group (if any) and prevent default rendering for it
248+
const accessorsGroup = groupsWithoutMethods?.find(g => g.title === 'Accessors');
249+
const groupsWithoutAccessors = groupsWithoutMethods?.filter(g => g.title !== 'Accessors');
260250

261251
customizedModel.groups = groupsWithoutAccessors;
262252
const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options);

0 commit comments

Comments
 (0)