defineFrameworkAdapter
defineFrameworkAdapter<
F,TFieldMeta>(adapter):FrameworkAdapter<F,TFieldMeta>
Defined in: packages/core/src/framework.ts:265
Registers a framework adapter, enforcing that all field and cell components are implemented and typed correctly.
This is a zero-runtime identity function — it returns the adapter unchanged.
All enforcement happens at the TypeScript level via the F HKT parameter:
missing components cause a type error, and each component gets autocomplete
for its field-specific props.
Type Parameters
Section titled “Type Parameters”F extends ComponentHKT
TFieldMeta
Section titled “TFieldMeta”TFieldMeta extends BaseFieldMeta = BaseFieldMeta
Parameters
Section titled “Parameters”adapter
Section titled “adapter”FrameworkAdapterInput<F, TFieldMeta>
The framework adapter implementation.
Returns
Section titled “Returns”FrameworkAdapter<F, TFieldMeta>
The same adapter, verified by TypeScript.
Example
Section titled “Example”import { defineFrameworkAdapter, ComponentHKT } from '@vexcms/core';import { ComponentType } from 'react';
interface ReactHKT extends ComponentHKT { component: ComponentType<this['_props']>;}
export const reactAdapter = defineFrameworkAdapter<ReactHKT>({ name: 'react', version: '0.1.0', fields: { text: MyTextInput, // TS error if missing or wrong props }, cells: { text: MyTextCell, },});- FrameworkAdapterInput for the full input type
- FrameworkAdapter for the resolved return type