import React from 'react'; import { LowCodeSchema } from '../types'; export interface SchemaEditorProps { /** 初始schema数据 */ initialSchema?: LowCodeSchema; /** 初始值 */ initialValues?: Record; /** 编辑器高度 */ height?: number | string; /** 是否只读 */ readonly?: boolean; /** 变更回调 */ onChange?: (schema: LowCodeSchema, values: Record) => void; /** 错误回调 */ onError?: (error: Error) => void; /** 自定义样式 */ className?: string; /** 是否显示预览 */ showPreview?: boolean; /** 预览配置 */ previewConfig?: { ALLOWED_TAGS?: string[]; ALLOWED_ATTR?: string[]; }; /** 自定义操作按钮,插入到 HTML 编辑器头部按钮区域 */ htmlActions?: React.ReactNode[]; } export interface SchemaEditorRef { /** 设置 Schema 数据 */ setSchema: (schema: LowCodeSchema) => void; /** 设置 HTML 模板内容 */ setHtmlContent: (html: string) => void; /** 设置 Schema JSON 字符串 */ setSchemaString: (jsonString: string) => void; /** 获取当前 Schema 数据 */ getSchema: () => LowCodeSchema; /** 获取当前 HTML 模板内容 */ getHtmlContent: () => string; /** 获取当前 Schema JSON 字符串 */ getSchemaString: () => string; /** 运行预览 */ run: () => void; /** 复制 HTML 内容 */ copyHtml: () => void; /** 复制 JSON 内容 */ copyJson: () => void; } export declare const SchemaEditor: React.ForwardRefExoticComponent>; export default SchemaEditor;