import { AllowedComponentProps, VNodeProps } from '../common' declare interface LinkData { url: string; text: string; isExternal?: boolean; } declare interface ParseOptions { /** * 是否将链接转换为可点击元素 * @default true */ enableLinks?: boolean; /** * 是否在新窗口打开外部链接 * @default true */ openExternalInNewWindow?: boolean; /** * 链接点击事件处理 */ onLinkClick?: (link: LinkData, event?: Event) => void; /** * 是否解析并高亮邮箱地址 * @default false */ parseEmail?: boolean; /** * 是否解析并高亮电话号码 * @default false */ parsePhone?: boolean; } declare interface ParseProps { // 内容 content?: string modelValue?: string // 解析选项 options?: ParseOptions // 解析模式 mode?: 'html' | 'text' | 'markdown' | 'json' encoding?: 'utf-8' | 'base64' | 'url' // 通用配置 maxLength?: number ellipsis?: string lines?: number // HTML 配置 useRichText?: boolean space?: 'ensp' | 'emsp' | 'nbsp' filterTags?: string[] allowTags?: string[] allowAttributes?: Record allowDomains?: string[] // 样式配置 customClass?: string customStyle?: string | Record textStyle?: string | Record // 功能配置 autolink?: boolean emoji?: boolean highlight?: boolean lazyLoad?: boolean errorFallback?: string // 事件配置 preventDefault?: boolean } declare interface ParseEmits { (e: 'update:modelValue', value: string): void (e: 'click', event: any): void (e: 'link-click', link: LinkData, event?: Event): void (e: 'linkpress', url: string): void (e: 'imageerror', src: string, error: Error): void (e: 'imageload', src: string): void (e: 'parse-error', error: Error): void (e: 'parse-success', result: any): void } declare interface _Parse { new(): { $props: AllowedComponentProps & VNodeProps & ParseProps $emit: ParseEmits } } export declare const Parse: _Parse export default Parse export type { LinkData, ParseOptions, ParseProps, ParseEmits }