--- /** * `` → remarkAutoTypeTable(fumadocs-typescript, 빌드 때) → `` * `type`의 description·type·default·parameters·returns는 MDX가 컴파일한 Astro vnode다. 행 펼침은 `
`(JS 없음). * 마크업은 `components/type-table.tsx`의 class를 따른다. */ import { archivePaths } from "../../lib/docs-archive"; import { ICONS } from "./icons"; // MDX가 만든 Astro JSX vnode는 .astro 표현식에서 렌더링되지 않는다("[object Object]"). MDX 모듈에 넘겨 Astro JSX renderer로 그린다. import RenderNode from "./RenderNode.mdx"; interface TypeNode { description?: unknown; type: unknown; typeDescription?: unknown; typeDescriptionLink?: string; default?: unknown; required?: boolean; deprecated?: boolean; parameters?: Array<{ name: string; description: unknown }>; returns?: unknown; } interface Props { type: Record; id?: string; } const { type, id } = Astro.props; const field = "text-fd-muted-foreground not-prose pe-2"; ---

Prop

Type

{Object.entries(type).map(([name, node]) => { const rowId = id ? `${id}-${name}` : undefined; const parameters = node.parameters ?? []; const hasContent = !!(node.description || node.default || parameters.length > 0 || node.returns); const nameClass = [ "text-fd-primary w-1/4 @max-xl:w-[unset] font-mono font-medium pe-2 shrink-0 break-all", node.deprecated && "line-through text-fd-primary/50", ]; return hasContent ? (
{name}{node.required ? "" : "?"} {node.typeDescriptionLink ? ( ) : ( )}
{node.type && (

Type

)} {node.default && (

Default

)} {parameters.length > 0 && (

Parameters

{parameters.map((param) => (

{param.name} -

))}
)} {node.returns && (

Returns

)}
) : (
{name}{node.required ? "" : "?"}
); })}