import { FC, ReactNode } from 'react'; import { generateDefinition } from './base.js'; import './types.js'; type TSDocProps = { /** * Parsed `type`, `interface` or `function` definition from * [`generateDefinition` function](https://nextra.site/api/generatedefinition). */ definition: ReturnType; /** * Override the function to render markdown into JSX nodes. * @default * async function renderMarkdownDefault(description?: string): Promise { * if (!description) return * const rawJs = await compileMdx(description) * return * } */ renderMarkdown?: typeof renderMarkdownDefault; /** * Type links map. * @default {} */ typeLinkMap?: Record; /** * Custom content to display when a function has no parameters. * @default This function does not accept any parameters. */ noParametersContent?: ReactNode; }; declare function renderMarkdownDefault(description?: string): Promise; /** * A built-in component lets you generate documentation from `type`, `interface`, and `function` * definitions using [TSDoc](https://tsdoc.org) annotations. * * ## What it generates * * ### For `type` and `interface` * * Generates a **properties table** with: * * - Name * - Type and description * - Default Value * - Permalink * * ### For `function` * * 1. **Parameters table**, including: * * - Name * - Type and description * - Default value * - Permalink * * 2. **Return signature table**, including: * - Description * - Return values table * * > [!TIP] * > * > - Permalink is a `#` anchor link for easy reference to individual rows. * > - Descriptions are parsed from inline TSDoc comments or the `@description` * > tag. * > - Supports full Markdown/MDX syntax in descriptions. * > - Default values are extracted from the `@default` or `@defaultValue` tags. * > - Return descriptions come from the `@returns` tag. * * > [!WARNING] * > * > **Server Component Only** – TSDoc component cannot be used in a client * > component.
* > **Available from:** Nextra 4.3 (alpha).
* > **Dependency:** Uses TypeScript Compiler API from * > [`ts-morph`](https://github.com/dsherret/ts-morph). * * @example * To generate the props table for the `TSDoc` component shown on this page: * * ```mdx * import { generateDefinition, TSDoc } from 'nextra/tsdoc' * * * export default MyProps` * })} * /> * ``` * * ### Overriding a type * * You can override the inferred type using the `@remarks` tag using backticks (`). * * */ declare const TSDoc: FC; export { TSDoc };