From 968cec758db2e2003b87fb13ae59035903f4d540 Mon Sep 17 00:00:00 2001 From: skrustev Date: Mon, 19 Oct 2026 17:57:53 +0300 Subject: [PATCH] fix(typedoc): Apply fix suggestion for generic base types. Remove duplicate members from base type. --- plugins/typedoc-plugin-react-components/src/main.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/typedoc-plugin-react-components/src/main.ts b/plugins/typedoc-plugin-react-components/src/main.ts index c3cedc5..c72eea8 100644 --- a/plugins/typedoc-plugin-react-components/src/main.ts +++ b/plugins/typedoc-plugin-react-components/src/main.ts @@ -210,6 +210,7 @@ function parseTypeProperties(type: ts.Type, context: Context) { if ( memberName.toString().startsWith('_') || excludeProperties.includes(memberName) || + (context.scope as DeclarationReflection).getChildByName?.(memberName) || !( modifiers === ModifierFlags.None || modifiers === ModifierFlags.Public || @@ -249,10 +250,15 @@ function parseTypeProperties(type: ts.Type, context: Context) { } function resolveBaseTypeProps(type: ts.Type, context: Context) { - if (!type.isClassOrInterface()) return; + const target = + type.flags & ts.TypeFlags.Object && + (type as ts.ObjectType).objectFlags & ts.ObjectFlags.Reference + ? (type as ts.TypeReference).target + : type; + if (!target.isClassOrInterface()) return; const baseTypes = context.checker - .getBaseTypes(type) + .getBaseTypes(target) .flatMap((base) => (base.isUnionOrIntersection() ? base.types : base)); for (const baseType of baseTypes) { parseTypeProperties(baseType, context);