import type { FormBaseControlSchema, FormControlProps, SchemaExpression } from '../types'; export * from './components/types'; /** * JSON Schema Editor * */ export interface JSONSchemaEditorControlSchema extends FormBaseControlSchema { /** * 指定为 JSON Schema Editor */ type: 'json-schema-editor'; /** * 可以理解为类型模板,方便快速定义复杂类型 */ shared?: { [propName: string]: { title: string; type: 'string' | 'number' | 'integer' | 'object' | 'array' | 'boolean' | 'null'; [propName: string]: any; }; }; /** @deprecated 请使用`shared` */ definitions?: JSONSchemaEditorControlSchema['shared']; /** * 顶层是否允许修改类型 */ rootTypeMutable?: boolean; /** * 顶层类型信息是否隐藏 */ showRootInfo?: boolean; /** * 禁用类型,默认禁用了 null 类型 */ disabledTypes?: Array; requireLabel?: string; /** * 开启详情配置 */ enableAdvancedSetting?: boolean; /** * 自定义详情配置面板如: * * { * boolean: [ * {type: "input-text", name: "aa", label: "AA" } * ] * } * * 当配置布尔字段详情时,就会出现以上配置 */ advancedSettings?: { [propName: string]: any; }; } export interface JSONSchemaEditorProps extends FormControlProps, Omit { } /** * JSON Schema * */ export interface JSONSchemaControlSchema extends FormBaseControlSchema { /** * 指定为 JSON Schema */ type: 'json-schema-form'; /** * json-schema 详情,支持关联上下文数据 */ schema?: Record | SchemaExpression; }