/** * hlxb-ui 组件库样式自动导入 vite 插件 * 参考 element-plus 的 unplugin-element-plus 实现的样式自动导入插件 * https://github.com/element-plus/unplugin-element-plus * * 功能说明: * - 自动检测 hlxb-ui 组件的导入语句 * - 根据组件名映射自动导入对应的样式文件 * - 支持自定义样式路径解析 * * 组件映射规则: * - 组件名格式:HlxbComponentName (PascalCase, 前缀Hlxb) * - 样式路径格式:hlxb-ui/component-name/style/index.css * - 目录名格式:kebab-case (小写字母,中划线连接) * * @example * // 自动生成的映射示例 * HlxbButton → 'button' → 'hlxb-ui/button/style/index.css' * HlxbInputNumber → 'input-number' → 'hlxb-ui/input-number/style/index.css' */ export interface HlxbUIStyleImportOptions { /** * 是否启用样式自动导入 * @default true */ importStyle?: boolean; /** * 自定义样式路径解析函数 * @param name 组件名称 (如: 'HlxbButton') * @returns 样式文件路径或路径数组,返回 undefined 使用默认路径 */ resolveStyle?: (name: string) => string | string[] | undefined; } /** * hlxb-ui 组件库样式自动导入插件 * 当导入组件时自动导入对应的样式文件 * * @example * import { HlxbInput } from 'hlxb-ui'; * // 自动导入: import 'hlxb-ui/es/input/style/index.css'; */ export declare function HlxbUIStyleImport(options?: HlxbUIStyleImportOptions): any; export default HlxbUIStyleImport;