import { ExtractPropTypes } from 'vue'; import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from '../../../shared.type'; import { computedFontSize, computedLabel, computedMessage, computedStyle, getInternalValue } from './renderless'; export type { ISharedRenderlessParamHooks } from '../../../shared.type'; export declare const $constants: { ITEM_NAME: string; }; export declare const userHeadProps: { _constants: { type: ObjectConstructor; default: () => { ITEM_NAME: string; }; }; /** * @property {Boolean} [min=false] - 小尺寸模式 */ min: BooleanConstructor; /** * @property {Boolean} [round=true] - 圆形模式 */ round: BooleanConstructor; /** * @property {String} [color=#ffffff] - 文字颜色 */ color: { type: StringConstructor; default: string; }; /** * @property {String} [backgroundColor=#BBBBBB] - 背景色 */ backgroundColor: { type: StringConstructor; default: string; }; /** * @property {String} [type=label] - 头像类型,icon|image|label 可选 */ type: { type: StringConstructor; default: string; validator: (value: string) => boolean; }; /** * @property {String} - 头像资源 * type=icon 时为图标类名,type=label时为字体串,type=image时为资源路径 */ value: { type: (StringConstructor | ObjectConstructor)[]; default: null; }; /** * @property {String} - 头像资源 * type=icon 时为图标类名,type=label时为字体串,type=image时为资源路径 */ modelValue: { type: (StringConstructor | ObjectConstructor)[]; default: null; }; /** * @property {Number} - 消息计数 */ messageTotal: (NumberConstructor | StringConstructor)[]; /** * @property {String} [messageType=details] - 消息类型 details|basic 可选 */ messageType: { type: StringConstructor; default: string; validator: (value: string) => boolean; }; /** * @property {Number} [messageUpperLimit=0] - 消息显示上限 */ messageUpperLimit: { type: NumberConstructor; default: number; }; size: { type: NumberConstructor; default: number; }; }; export interface IUserHeadState { internalValue: string | Record; label: string; style: ReturnType>; message: string; fontSize: { fontSize: string; }; size: number; color: string; backgroundColor: string; } export type IUserHeadProps = ExtractPropTypes; export type IUserHeadConstants = typeof $constants; export type IUserHeadRenderlessParams = ISharedRenderlessFunctionParams & { api: IUserHeadApi; state: IUserHeadState; props: IUserHeadProps; }; export interface IUserHeadApi { state: IUserHeadState; computedLabel: ReturnType; computedStyle: ReturnType; computedMessage: ReturnType; computedFontSize: ReturnType; getInternalValue: ReturnType; handleClick: (event: Event) => void; mouseEnter: (event: Event) => void; } export type IUserHeadRenderlessParamUtils = ISharedRenderlessParamUtils;