Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from '@plugin/theme/lib/index.js';
import {
ContainerReflection,
DeclarationReflection,
ReflectionGroup,
ReflectionKind,
} from 'typedoc';
Expand Down Expand Up @@ -54,7 +53,7 @@ export function body(
} else {
md.push(
this.partials.members(
group.children as DeclarationReflection[],
group.children.filter(child => child.isDeclaration()),
{
headingLevel: options.headingLevel,
},
Expand Down Expand Up @@ -83,9 +82,9 @@ export function body(
children: model.children,
} as ReflectionGroup),
);
} else {
} else if (model.children) {
md.push(
this.partials.members(model.children as DeclarationReflection[], {
this.partials.members(model.children, {
headingLevel: options.headingLevel,
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
sortNoneSectionFirst,
} from '@plugin/theme/lib/index.js';
import {
DeclarationReflection,
ReflectionCategory,
ReflectionKind,
} from 'typedoc';
Expand All @@ -26,9 +25,9 @@ export function categories(
}
md.push(this.partials.groupIndex(category));
} else {
const categoryChildren = category.children?.filter(
const categoryChildren = category.children.filter(
(child) => child.kind !== ReflectionKind.Constructor,
);
).filter(child => child.isDeclaration());
if (categoryChildren.length) {
if (!isNoneSection(category)) {
md.push(heading(options.headingLevel, category.title));
Expand All @@ -37,7 +36,7 @@ export function categories(
md.push(this.helpers.getCommentParts(category.description));
}
md.push(
this.partials.members(categoryChildren as DeclarationReflection[], {
this.partials.members(categoryChildren, {
headingLevel: isNoneSection(category)
? options.headingLevel
: options.headingLevel + 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from '@plugin/theme/lib/index.js';
import {
ContainerReflection,
DeclarationReflection,
i18n,
ProjectReflection,
ReflectionKind,
Expand Down Expand Up @@ -97,7 +96,7 @@ export function groups(
) {
md.push(
this.partials.propertiesTable(
group.children as DeclarationReflection[],
group.children.filter(child => child.isDeclaration()),
{
isEventProps,
kind: options.kind,
Expand All @@ -107,13 +106,13 @@ export function groups(
} else if (isEnumGroup && this.helpers.useTableFormat('enums')) {
md.push(
this.partials.enumMembersTable(
group.children as DeclarationReflection[],
group.children.filter(child => child.isDeclaration()),
),
);
} else {
if (group.children) {
md.push(
this.partials.members(group.children as DeclarationReflection[], {
this.partials.members(group.children.filter(child => child.isDeclaration()), {
headingLevel: isNoneSection(group)
? options.headingLevel
: options.headingLevel + 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export function members(
}
return true;
};
const items = model?.filter((item) => !this.router.hasOwnDocument(item));
items?.forEach((item, index) => {
const items = model.filter((item) => !this.router.hasOwnDocument(item));
items.forEach((item, index) => {
md.push(
this.partials.memberContainer(item, {
headingLevel: options.headingLevel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ export function groupIndex(group: ReflectionGroup | ReflectionCategory) {
if (this.options.getValue('indexFormat').toLowerCase().includes('table')) {
return getGroupIndexTable(
this,
group.children as DeclarationReflection[] | DocumentReflection[],
group.children,
);
}
return getGroupIndexList(
this,
group.children as DeclarationReflection[] | DocumentReflection[],
group.children,
);
}

export function getGroupIndexList(
context: MarkdownThemeContext,
children: DeclarationReflection[] | DocumentReflection[],
children: (DeclarationReflection | DocumentReflection)[],
) {
const filteredChildren =
children
Expand Down