import React from 'react'; import ReactMarkdown from 'react-markdown'; import { InlineCode } from '~/components/base/code'; import { B, P } from '~/components/base/paragraph'; import { H2, H2Nested, H3Code, H4 } from '~/components/plugins/Headings'; import { ClassDefinitionData, GeneratedData, PropData, } from '~/components/plugins/api/APIDataTypes'; import { APISectionDeprecationNote } from '~/components/plugins/api/APISectionDeprecationNote'; import { renderMethod } from '~/components/plugins/api/APISectionMethods'; import { renderProp } from '~/components/plugins/api/APISectionProps'; import { CommentTextBlock, getTagData, getTagNamesList, mdComponents, resolveTypeName, STYLES_APIBOX, STYLES_NESTED_SECTION_HEADER, TypeDocKind, } from '~/components/plugins/api/APISectionUtils'; export type APISectionClassesProps = { data: GeneratedData[]; }; const isProp = (child: PropData) => child.kind === TypeDocKind.Property && !child.overwrites && !child.name.startsWith('_') && !child.implementationOf; const isMethod = (child: PropData, allowOverwrites: boolean = false) => child.kind === TypeDocKind.Method && (allowOverwrites || !child.overwrites) && !child.name.startsWith('_') && !child?.implementationOf; const renderClass = (clx: ClassDefinitionData, exposeInSidebar: boolean): JSX.Element => { const { name, comment, type, extendedTypes, children, implementedTypes } = clx; const Header = exposeInSidebar ? H2Nested : H4; const isSensorClass = name.endsWith('Sensor'); const className = isSensorClass ? name.replace('Sensor', '') : name; const properties = children?.filter(isProp); const methods = children ?.filter(child => isMethod(child, isSensorClass)) .sort((a: PropData, b: PropData) => a.name.localeCompare(b.name)); const returnComment = getTagData('returns', comment); return (
Type:
{type ?