context.ts
521 Bytes
import { createContext } from 'react'
export interface QxFieldExtract {
widget: string;
$base?: boolean;
allowSelect?: boolean;
fieldKey: string;
fieldType: string;
fieldGroupType?: string;
relId?: string;
[key: string]: any;
}
export interface QxField {
name: string;
code: string;
extract: QxFieldExtract;
}
export interface FieldContextType {
fields: QxField[];
setFields: (fields: QxField[]) => void
}
export const FieldContext = createContext<FieldContextType>({} as FieldContextType)