import { App, Component } from 'vue'; /** * @description: Set ui mount node */ export declare function getPopupContainer(node?: HTMLElement): HTMLElement; /** * 事件处理函数的类型约束,用于支持组件的 onClick 事件 */ type EventShim = { new (...args: any[]): { $props: { onClick?: (...args: any[]) => void; }; }; }; /** * 提取 Vue 组件的 props 类型的工具类型 * @template T - Vue 组件类型 * @returns 如果组件有 $props 属性则返回其类型,否则返回 any */ type ComponentProps = T extends { new (...args: any[]): { $props: infer P; }; } ? P : any; /** * 为组件添加全局安装方法的类型定义 * @template T - 原始组件类型 * @template P - 自定义 props 类型,默认为组件原始 props 类型 * @description * - 当不指定 P 时,自动保留组件原始的 props 类型 * - 当指定 P 时,使用自定义的 props 类型覆盖原始类型 * - 添加 install 方法用于全局注册组件 */ export type WithInstall> = T & { install(app: App): void; new (...args: any[]): { $props: P; }; } & EventShim; /** * 自定义组件类型,扩展了 Vue 的 Component 类型 * @description 支持可选的 displayName 属性用于组件名称显示 */ export type CustomComponent = Component & { displayName?: string; }; /** * 为 Vue 组件添加全局安装功能的工具函数 * * @example * // 方式1:基础用法 - 保留原始类型(可能丢失 JSDoc) * const MyButton = withInstall(ButtonComponent) * * // 方式2:推荐用法 - 保留 Props JSDoc 文档信息 * const MyGrid = withInstall(GridComponent) * * // 使用 * import { HlxbGrid } from 'hlxb-ui'; // IDE 会显示 props 的完整 JSDoc 信息 */ export declare const withInstall: >(component: T, alias?: string) => WithInstall; /** 统一处理单位转换 */ export declare function normalizeUnit(value: T): T extends undefined | null ? string | undefined : string; export declare function error(message: string): void; export declare function isProdMode(): boolean; export {};