import { SlatePlugin, Value } from 'platejs'; import { PlatePlugin } from 'platejs/react'; /** * 编辑器插件类型 * 支持 PlatePlugin(React)和 SlatePlugin(Core) */ export type EditorPlugin = PlatePlugin | SlatePlugin; /** * 编辑器插件数组类型 * 使用宽松的数组类型以兼容各种插件组合场景 */ export type EditorPluginKit = EditorPlugin[]; /** * 插件配置选项 */ export interface PluginKitOptions { /** 是否启用插件 */ enabled?: boolean; /** 插件配置 */ config?: Record; } /** * 插件工厂函数类型 */ export type PluginKitFactory = (options?: PluginKitOptions) => EditorPluginKit; /** * 编辑器值类型 */ export type EditorValue = Value;