import { AllowedComponentProps, VNodeProps } from '../common' // 卡片操作按钮类型 declare interface CardAction { text: string type?: 'primary' | 'success' | 'warning' | 'danger' | 'default' plain?: boolean disabled?: boolean loading?: boolean data?: any click?: Function } // 卡片属性接口 declare interface CardProps { // 基础属性 title?: string subtitle?: string description?: string extra?: string // 显示控制 size?: 'small' | 'medium' | 'large' shadow?: 'none' | 'small' | 'medium' | 'large' | 'hover' border?: 'none' | 'solid' | 'dashed' full?: boolean hoverable?: boolean disabled?: boolean // 加载状态 loading?: boolean loadingText?: string loadingIcon?: string // 角标 badge?: string | number badgeContent?: string | number badgeType?: 'primary' | 'success' | 'warning' | 'danger' | 'info' badgeMax?: number badgeDot?: boolean badgePosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' badgeStyle?: Record // 标题区域 titleIcon?: string titleIconSize?: string | number titleIconColor?: string titleStyle?: Record subtitleStyle?: Record descriptionStyle?: Record // 内容区域 bodyStyle?: CSSProperties // 封面图片 coverImage?: string coverMode?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right' coverTag?: string lazyLoad?: boolean showMenuByLongpress?: boolean // 底部区域 footer?: string actions?: CardAction[] actionSize?: 'mini' | 'small' | 'medium' | 'large' // 自定义样式 customStyle?: Record radius?: string | number padding?: string | number margin?: string | number } // 卡片事件接口 declare interface CardEmits { (e: 'click', event: MouseEvent) (e: 'longpress', event: TouchEvent) (e: 'cover-click', event: MouseEvent) (e: 'action-click', action: CardAction, index: number) (e: 'image-load', event: any) (e: 'image-error', event: any) } // 卡片插槽接口 declare interface CardSlots { // 默认插槽 default?: () => any // 命名插槽 header?: () => any title?: () => any cover?: () => any 'cover-tag'?: () => any extra?: () => any footer?: () => any } // 卡片组件实例 declare interface _Card { new(): { // 属性 $props: AllowedComponentProps & VNodeProps & CardProps // 事件 $emit: CardEmits // 插槽 $slots: CardSlots } } // 导出卡片组件 export declare const Card: _Card export default Card // 导出类型 export type { CardProps, CardAction, CardEmits, CardSlots }