import React from 'react';
import { renderMethod } from './APISectionMethods';
import { InlineCode } from '~/components/base/code';
import { B, P } from '~/components/base/paragraph';
import { H2, H3Code, H4 } from '~/components/plugins/Headings';
import { APIDataType } from '~/components/plugins/api/APIDataType';
import {
CommentData,
InterfaceDefinitionData,
MethodSignatureData,
PropData,
} from '~/components/plugins/api/APIDataTypes';
import { APISectionDeprecationNote } from '~/components/plugins/api/APISectionDeprecationNote';
import { APISectionPlatformTags } from '~/components/plugins/api/APISectionPlatformTags';
import {
CommentTextBlock,
getTagData,
mdInlineComponents,
parseCommentContent,
renderFlags,
renderParamRow,
renderTableHeadRow,
resolveTypeName,
renderDefaultValue,
STYLES_APIBOX,
STYLES_NESTED_SECTION_HEADER,
getTagNamesList,
} from '~/components/plugins/api/APISectionUtils';
import { Cell, Row, Table } from '~/ui/components/Table';
export type APISectionInterfacesProps = {
data: InterfaceDefinitionData[];
};
const renderInterfaceComment = (
comment?: CommentData,
signatures?: MethodSignatureData[],
defaultValue?: string
) => {
if (signatures && signatures.length) {
const { type, parameters, comment: signatureComment } = signatures[0];
const initValue = defaultValue || getTagData('default', signatureComment)?.text;
return (
<>
{parameters?.length ? parameters.map(param => renderParamRow(param)) : null}
Returns:
Extends:
{extendedTypes.map(extendedType => (