import type { Editor } from "@tiptap/react";
import type { AnyExtension } from "@tiptap/core";
import type { ReactNode } from "react";
import type { LucideIcon } from "lucide-react";
import type { EditorLocale } from "@/shared/locales";
import type { HeadingLevel } from "@/core/commands/editorCommands";
import type { BuiltinSlashCommandKey as CoreBuiltinSlashCommandKey } from "@/core/extensions/SlashCommands";
/** 工具栏内置项 Key。 */
export declare const BuiltinToolbarItemKey: {
    readonly Heading: "heading";
    readonly BulletList: "bulletList";
    readonly OrderedList: "orderedList";
    readonly TaskList: "taskList";
    readonly Blockquote: "blockquote";
    readonly InsertTable: "insertTable";
    readonly CodeBlock: "codeBlock";
    readonly InlineMath: "inlineMath";
    readonly BlockMath: "blockMath";
    readonly Image: "image";
    readonly Video: "video";
    readonly UploadAttachment: "uploadAttachment";
    readonly Bold: "bold";
    readonly Italic: "italic";
    readonly Underline: "underline";
    readonly Strikethrough: "strikethrough";
    readonly InlineCode: "inlineCode";
    readonly Link: "link";
    readonly Highlight: "highlight";
    readonly TextColor: "textColor";
    readonly Superscript: "superscript";
    readonly Subscript: "subscript";
    readonly AlignLeft: "alignLeft";
    readonly AlignCenter: "alignCenter";
    readonly AlignRight: "alignRight";
    readonly AlignJustify: "alignJustify";
    readonly DecreaseIndent: "decreaseIndent";
    readonly IncreaseIndent: "increaseIndent";
};
export type BuiltinToolbarItemKey = (typeof BuiltinToolbarItemKey)[keyof typeof BuiltinToolbarItemKey];
export declare const BuiltinSlashCommandKey: {
    readonly Paragraph: "paragraph";
    readonly Heading1: "heading1";
    readonly Heading2: "heading2";
    readonly Heading3: "heading3";
    readonly Heading4: "heading4";
    readonly Heading5: "heading5";
    readonly Heading6: "heading6";
    readonly BulletList: "bulletList";
    readonly NumberedList: "numberedList";
    readonly TaskList: "taskList";
    readonly Blockquote: "blockquote";
    readonly InlineCode: "inlineCode";
    readonly CodeBlock: "codeBlock";
    readonly Table: "table";
    readonly InlineMath: "inlineMath";
    readonly BlockMath: "blockMath";
    readonly Image: "image";
    readonly Video: "video";
    readonly UploadAttachment: "uploadAttachment";
};
export type BuiltinSlashCommandKey = CoreBuiltinSlashCommandKey;
/** 工具栏/斜杠项分组，渲染时用于自动插入分隔符。 */
export type EditorItemGroup = string;
/** 编辑行为上下文：统一注入给自定义动作，避免业务方自行拼装。 */
export interface EditorActionContext {
    editor: Editor;
    locale: EditorLocale;
    format: {
        toggleBold: () => void;
        toggleItalic: () => void;
        toggleUnderline: () => void;
        toggleStrike: () => void;
        toggleCode: () => void;
        setLink: (href: string) => void;
        unsetLink: () => void;
        toggleSuperscript: () => void;
        toggleSubscript: () => void;
        setTextAlign: (align: "left" | "center" | "right" | "justify") => void;
        setColor: (color: string) => void;
        unsetColor: () => void;
        setHighlight: (color: string) => void;
        unsetHighlight: () => void;
    };
    block: {
        setHeading: (level: HeadingLevel) => void;
        setParagraph: () => void;
        toggleHeading: (level: HeadingLevel) => void;
        toggleCodeBlock: () => void;
        toggleBlockquote: () => void;
        setCodeBlockLanguage: (language: string) => void;
        toggleBulletList: () => void;
        toggleOrderedList: () => void;
        toggleTaskList: () => void;
        decreaseIndent: () => void;
        increaseIndent: () => void;
        canDecreaseIndent: () => boolean;
        canIncreaseIndent: () => boolean;
        insertTable: (options?: {
            rows?: number;
            cols?: number;
            withHeaderRow?: boolean;
        }) => void;
    };
    dialogs: {
        openInlineMath: () => void;
        openBlockMath: () => void;
        openImage: () => void;
        openVideo: () => void;
        openFileUpload: () => void;
    };
}
/** 工具栏内置项配置。 */
export interface ToolbarBuiltinItemConfig {
    type: "builtin";
    key: BuiltinToolbarItemKey;
    group?: EditorItemGroup;
}
/** 工具栏自定义项配置。 */
export interface ToolbarCustomItemConfig {
    type: "custom";
    key: string;
    title: string;
    icon?: ReactNode;
    group?: EditorItemGroup;
    onClick: (ctx: EditorActionContext) => void;
    isActive?: (ctx: EditorActionContext) => boolean;
    isDisabled?: (ctx: EditorActionContext) => boolean;
}
/** 工具栏项配置（内置 + 自定义）。 */
export type ToolbarItemConfig = ToolbarBuiltinItemConfig | ToolbarCustomItemConfig;
/** 斜杠内置项配置。 */
export interface SlashBuiltinCommandConfig {
    type: "builtin";
    key: CoreBuiltinSlashCommandKey;
    group?: EditorItemGroup;
}
/** 斜杠自定义项配置。 */
export interface SlashCustomCommandConfig {
    type: "custom";
    key: string;
    title: string;
    description?: string;
    icon?: LucideIcon;
    group?: EditorItemGroup;
    command: ({ editor }: {
        editor: Editor;
    }) => void;
    disabled?: (ctx: {
        editor: Editor;
    }) => boolean;
}
/** 斜杠项配置（内置 + 自定义）。 */
export type SlashCommandConfig = SlashBuiltinCommandConfig | SlashCustomCommandConfig;
/** 对外暴露扩展类型别名，避免业务侧重复引入 TipTap 类型。 */
export type EditorExternalExtension = AnyExtension;
/** 默认工具栏配置（按当前内置顺序与分组）。 */
export declare function createDefaultToolbarItems(locale: EditorLocale): ToolbarItemConfig[];
/** 默认斜杠配置（按当前内置顺序与分组）。 */
export declare function createDefaultSlashCommands(locale: EditorLocale): SlashCommandConfig[];
/** 工具栏 key 校验。 */
export declare function isBuiltinToolbarItemKey(key: string): key is BuiltinToolbarItemKey;
/** 斜杠 key 校验。 */
export declare function isBuiltinSlashCommandKey(key: string): key is CoreBuiltinSlashCommandKey;
/**
 * 按「默认项 + 用户项」构建最终配置。
 * - 同 key 用户项覆盖默认项；
 * - 覆盖后按用户声明顺序移动到末尾，便于重排；
 * - 非法内置 key 仅 warning，不中断渲染。
 */
export declare function mergeConfigItems<T extends {
    key: string;
    type: "builtin" | "custom";
}>(defaults: T[], overrides: T[] | undefined, hideDefaults: boolean, isBuiltinKey: (key: string) => boolean, warnPrefix: string): T[];
