import * as React from "react"; import { ConfigConsumerProps } from "../Config"; export interface ITooltipProps { /** * 触发行为,可选 hover/click/focus * * @default 'hover' **/ trigger?: "hover" | "click" | "focus"; /** * 组件自定样式 * * @default '' **/ className?: string; /** * 提示框内容 * * @default **/ title?: React.ReactNode; /** * 提示框内容 * * @default **/ content?: React.ReactNode; /** * 鼠标移入后延时多少才显示 Tooltip,单位:毫秒 * * @default 0 **/ mouseEnterDelay?: number; /** * 鼠标移出后延时多少才显示 Tooltip,单位:毫秒 * * @default 0 **/ mouseLeaveDelay?: number; /** * 是否有箭头 * * @default true **/ hasArrow?: boolean; /** * 是否有关闭按钮 * * @default false **/ hasClose?: boolean; /** * 气泡框位置,可选 top left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottom * * @default 'bottom' **/ placement?: "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom"; /** * 显示隐藏的回调 * * @default () => void **/ onVisibleChange?: (isShow: boolean) => void; /** * 节点内容 * * **/ children: React.ReactNode; /** * 默认前缀 * * @default "lg" **/ prefixCls?: string; /** * 自定义外框class前缀 * * @default **/ overlayCls?: string; /** * 自定义外框样式 * * @default **/ overlayStyle?: React.CSSProperties; /** * 自定义被描述对象的class * * @default **/ itemCls?: string; } interface ITooltipStates { showPopper: boolean; } declare class Tooltip extends React.PureComponent { private enterTimer; private leaveTimer; private container; private wrapper; private prefixCls; static defaultProps: { trigger: string; className: string; mouseEnterDelay: number; mouseLeaveDelay: number; hasArrow: boolean; hasClose: boolean; placement: string; onVisibleChange: () => null; itemCls: string; }; constructor(props: ITooltipProps); componentDidMount(): void; componentDidUpdate(): void; componentWillUnmount(): void; setEleStyle(): void; handleClickOutside(e: any): void; handleClick(): void; showPopper(): void; hidePopper(): void; getLayout: (prefixCls: any) => JSX.Element; renderChild: (child: any) => React.ForwardRefExoticComponent>; renderTooltip: ({ getPrefixCls }: ConfigConsumerProps) => JSX.Element; render(): JSX.Element; } export default Tooltip;