import { CustomField } from './CustomField' ; /**
 * 字段通用信息
 */ interface FastFormFieldCommon { name : string ; label ? : string ; defaultValue ? : any ; [ other ] : any ; } export interface FastFormFieldProps extends FastFormFieldCommon { value : any ; error : string | undefined ; onChange : ( val : any ) => void ; } /**
 * 字段组件
 */ export type FastFormFieldComponent < T = Record < string , unknown > > = React . ComponentType < FastFormFieldProps & T > ; const fieldMap = new Map < string , FastFormFieldComponent > ( ) ; /**
 * 注册组件
 */ export function regField ( type , component ) { fieldMap . set ( type , component ) ; } /**
 * 获取组件
 */ export function getField ( type ) { return fieldMap . get ( type ) ; } /**
 * 字段配置
 */ export interface FastFormFieldMeta extends FastFormFieldCommon { type : string ; } regField ( 'custom' , CustomField ) ;