import { z } from 'zod'; import { Value } from 'platejs'; /** 语言设置 Schema */ export declare const LocaleSchema: z.ZodEnum<{ "en-US": "en-US"; "zh-CN": "zh-CN"; }>; /** 自定义请求头 Schema */ export declare const CustomHeadersSchema: z.ZodRecord; /** 上传配置 Schema */ export declare const UploadConfigSchema: z.ZodOptional; fieldName: z.ZodDefault>; maxSize: z.ZodDefault>; acceptTypes: z.ZodOptional>; headers: z.ZodOptional>; extraData: z.ZodOptional>; customUpload: z.ZodOptional>; }, z.core.$strict>>; /** AI 配置 Schema */ export declare const AIConfigSchema: z.ZodOptional; commandUrl: z.ZodOptional; apiKey: z.ZodOptional; headers: z.ZodOptional>; model: z.ZodOptional; customCopilot: z.ZodOptional>; customCommand: z.ZodOptional>; }, z.core.$strict>>; /** 编辑器配置 Schema */ export declare const EditorConfigSchema: z.ZodObject<{ baseURL: z.ZodOptional; aiApiUrl: z.ZodOptional; aiApiKey: z.ZodOptional; ai: z.ZodOptional; commandUrl: z.ZodOptional; apiKey: z.ZodOptional; headers: z.ZodOptional>; model: z.ZodOptional; customCopilot: z.ZodOptional>; customCommand: z.ZodOptional>; }, z.core.$strict>>; uploadApiUrl: z.ZodOptional; upload: z.ZodOptional; fieldName: z.ZodDefault>; maxSize: z.ZodDefault>; acceptTypes: z.ZodOptional>; headers: z.ZodOptional>; extraData: z.ZodOptional>; customUpload: z.ZodOptional>; }, z.core.$strict>>; locale: z.ZodDefault>>; customHeaders: z.ZodOptional>; }, z.core.$strict>; /** 工具栏对齐方式 */ export declare const ToolbarAlignSchema: z.ZodEnum<{ center: "center"; left: "left"; right: "right"; }>; /** 工具栏特性 ID */ export declare const ToolbarFeatureIdSchema: z.ZodEnum<{ link: "link"; blockquote: "blockquote"; code: "code"; h1: "h1"; h2: "h2"; h3: "h3"; table: "table"; bold: "bold"; media: "media"; fontSize: "fontSize"; align: "align"; redo: "redo"; undo: "undo"; comment: "comment"; lineHeight: "lineHeight"; italic: "italic"; underline: "underline"; strikethrough: "strikethrough"; subscript: "subscript"; superscript: "superscript"; highlight: "highlight"; emoji: "emoji"; indent: "indent"; codeBlock: "codeBlock"; export: "export"; import: "import"; outdent: "outdent"; bulletedList: "bulletedList"; numberedList: "numberedList"; todoList: "todoList"; horizontalRule: "horizontalRule"; fontColor: "fontColor"; more: "more"; }>; /** 工具栏分组 ID */ export declare const ToolbarGroupIdSchema: z.ZodEnum<{ marks: "marks"; blocks: "blocks"; history: "history"; insert: "insert"; more: "more"; headings: "headings"; alignment: "alignment"; lists: "lists"; tools: "tools"; }>; /** 工具栏配置 Schema */ export declare const ToolbarConfigSchema: z.ZodObject<{ enabledFeatures: z.ZodOptional>>; disabledFeatures: z.ZodOptional>>; enabledGroups: z.ZodOptional>>; disabledGroups: z.ZodOptional>>; toolbarAlign: z.ZodOptional>; toolbarFullWidth: z.ZodOptional; toolbarClassName: z.ZodOptional; toolbarStyle: z.ZodOptional>>; }, z.core.$strip>; /** Slate 文本节点 Schema */ export declare const SlateTextSchema: z.ZodType<{ text: string; }>; /** Slate 元素节点 Schema(递归) */ export declare const SlateElementSchema: z.ZodType<{ type?: string; children: Array<{ text: string; } | { type?: string; children: unknown[]; }>; }>; /** Slate Value Schema */ export declare const SlateValueSchema: z.ZodArray; }, unknown, z.core.$ZodTypeInternals<{ type?: string; children: Array<{ text: string; } | { type?: string; children: unknown[]; }>; }, unknown>>>; /** 自动保存配置 Schema */ export declare const AutoSaveConfigSchema: z.ZodObject<{ storageKey: z.ZodDefault>; interval: z.ZodDefault>; saveOnChange: z.ZodDefault>; debounceTime: z.ZodDefault>; maxVersions: z.ZodDefault>; enabled: z.ZodDefault>; }, z.core.$strip>; /** Copilot 配置 Schema */ export declare const CopilotConfigSchema: z.ZodObject<{ apiUrl: z.ZodOptional; headers: z.ZodOptional>; systemPrompt: z.ZodOptional; debounceDelay: z.ZodDefault>; useFallbackOnError: z.ZodDefault>; shortcuts: z.ZodOptional; acceptNextWord: z.ZodOptional; reject: z.ZodOptional; triggerSuggestion: z.ZodOptional; }, z.core.$strip>>; enabled: z.ZodDefault>; }, z.core.$strip>; export type ValidatedEditorConfig = z.infer; export type ValidatedToolbarConfig = z.infer; export type ValidatedAutoSaveConfig = z.infer; export type ValidatedCopilotConfig = z.infer; export type ValidatedSlateValue = z.infer; /** * 验证编辑器配置 * @param config 配置对象 * @returns 验证结果 */ export declare function validateEditorConfig(config: unknown): { success: true; data: ValidatedEditorConfig; } | { success: false; error: z.ZodError; }; /** * 验证工具栏配置 * @param config 配置对象 * @returns 验证结果 */ export declare function validateToolbarConfig(config: unknown): { success: true; data: ValidatedToolbarConfig; } | { success: false; error: z.ZodError; }; /** * 验证自动保存配置 * @param config 配置对象 * @returns 验证结果 */ export declare function validateAutoSaveConfig(config: unknown): { success: true; data: ValidatedAutoSaveConfig; } | { success: false; error: z.ZodError; }; /** * 验证 Slate 内容 * @param value Slate 内容 * @returns 验证结果 */ export declare function validateSlateValue(value: unknown): { success: true; data: ValidatedSlateValue; } | { success: false; error: z.ZodError; }; /** * 验证并合并编辑器配置(带默认值) * @param config 用户配置 * @returns 合并后的完整配置 */ export declare function parseEditorConfig(config: unknown): ValidatedEditorConfig; /** * 验证 Slate 内容是否为有效结构 * @param value 要验证的内容 * @returns 是否有效 */ export declare function isValidSlateValue(value: unknown): value is Value; /** * 获取验证错误的友好消息 * @param error Zod 错误对象 * @returns 格式化的错误消息数组 */ export declare function getValidationErrorMessages(error: z.ZodError): string[]; /** * 创建带验证的配置解析器 * @param schema Zod Schema * @returns 解析函数 */ export declare function createConfigParser(schema: z.ZodType): { parse: (config: unknown) => T; safeParse: (config: unknown) => z.ZodSafeParseResult; validate: (config: unknown) => config is T; };