/** * 用来定义数据结构的编辑器 */ import React from 'react'; import type { JSONSchema, ReactPropsBase } from 'jamis-core'; import type { JSONSchema7TypeName } from 'json-schema'; import type { JSONSchemaEditorControlSchema } from '../types'; export interface SchemaEditorProps extends ReactPropsBase, Pick { value?: JSONSchema; onChange: (value: JSONSchema) => void; disabled?: boolean; defaultType: JSONSchema7TypeName; renderExtraProps?: (value: JSONSchema, onChange: (value: JSONSchema) => void) => JSX.Element; renderModalProps?: (value: JSONSchema, onChange: (value: JSONSchema) => void) => JSX.Element; disabledTypes?: Array; /** * 预设模板 */ shared?: { [propName: string]: { type: 'string' | 'number' | 'integer' | 'object' | 'array' | 'boolean' | 'null'; title: string; [propName: string]: any; }; }; /** @deprecated 请使用`shared` */ definitions?: SchemaEditorProps['shared']; /** * 顶层是否允许修改类型 */ rootTypeMutable: boolean; /** * 顶层类型信息是否隐藏 */ showRootInfo: boolean; /** * 是否开启高级配置 */ enableAdvancedSetting?: boolean; } export declare class SchemaEditor extends React.Component { static defaultProps: Pick; defaultTypes: Array; constructor(props: SchemaEditorProps); handleTypeChange(type: string, value: any, origin: any): any; render(): JSX.Element; } export default SchemaEditor;