import ReactMarkdown from 'react-markdown'; import { ClassDefinitionData, GeneratedData, PropData, } from '~/components/plugins/api/APIDataTypes'; import { APISectionDeprecationNote } from '~/components/plugins/api/APISectionDeprecationNote'; import { renderMethod } from '~/components/plugins/api/APISectionMethods'; import { CommentTextBlock, getTagData, getTagNamesList, mdComponents, STYLES_APIBOX, TypeDocKind, H3Code, getCommentContent, BoxSectionHeader, } from '~/components/plugins/api/APISectionUtils'; import { H2, MONOSPACE } from '~/ui/components/Text'; export type APISectionNamespacesProps = { data: GeneratedData[]; }; const isMethod = (child: PropData, allowOverwrites: boolean = false) => child.kind && [TypeDocKind.Method, TypeDocKind.Function].includes(child.kind) && (allowOverwrites || !child.overwrites) && !child.name.startsWith('_') && !child?.implementationOf; const renderNamespace = (namespace: ClassDefinitionData, exposeInSidebar: boolean): JSX.Element => { const { name, comment, children } = namespace; const methods = children ?.filter(child => isMethod(child)) .sort((a: PropData, b: PropData) => a.name.localeCompare(b.name)); const returnComment = getTagData('returns', comment); return (