> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Function: defineComponent()

> **defineComponent**\<`T` _extends_ `$ZodObject`\<`Readonly`\<`Readonly`\<\{\[`k`: `string`]: `$ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`>>; }>>, `$ZodObjectConfig`>>(`config`: `object`): [`DefinedComponent`](/next/zh/api/genui/openui/core/type-aliases/DefinedComponent.md)\<`T`>

定义 ReactLynx 组件渲染器及其 OpenUI schema 元数据。

## Type Parameters

| Type Parameter                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `T` _extends_ `$ZodObject`\<`Readonly`\<`Readonly`\<\{\[`k`: `string`]: `$ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`>>; }>>, `$ZodObjectConfig`> |

## Parameters

| Parameter            | Type                                                                                                                                                                                 |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `config`             | \{ `component`: [`ComponentRenderer`](/next/zh/api/genui/openui/core/type-aliases/ComponentRenderer.md)\<`output`\<`T`>>; `description`: `string`; `name`: `string`; `props`: `T`; } |
| `config.component`   | [`ComponentRenderer`](/next/zh/api/genui/openui/core/type-aliases/ComponentRenderer.md)\<`output`\<`T`>>                                                                             |
| `config.description` | `string`                                                                                                                                                                             |
| `config.name`        | `string`                                                                                                                                                                             |
| `config.props`       | `T`                                                                                                                                                                                  |

## Returns

[`DefinedComponent`](/next/zh/api/genui/openui/core/type-aliases/DefinedComponent.md)\<`T`>
