import { Node } from '@tiptap/core'; export type AlertVariant = 'info' | 'warning' | 'error' | 'success' | 'default'; export type AlertType = 'text' | 'icon'; export interface AlertOptions { /** * HTML attributes to add to the alert element * @default {} * @example { class: 'foo' } */ HTMLAttributes: Record; } declare module '@tiptap/core' { interface Commands { alert: { /** 插入一个 Alert 节点 */ setAlert: (attributes?: { variant?: AlertVariant; type?: AlertType; }) => ReturnType; /** 切换 Alert 的 variant */ setAlertVariant: (variant: AlertVariant) => ReturnType; /** 切换 Alert 的展示类型(是否显示图标) */ setAlertType: (type: AlertType) => ReturnType; /** 在当前块与 Alert 之间切换(将当前块转换为 Alert,若已是 Alert 则还原为段落) */ toggleAlert: (attributes?: { variant?: AlertVariant; type?: AlertType; }) => ReturnType; }; } } export declare const AlertExtension: Node; export default AlertExtension;