import React from 'react'; import { type TooltipProps } from '../Tooltip'; import type { PolymorphicProps, PolymorphicComponent } from '../../utils/polymorphicComponent'; interface TextEllipsisBaseProps extends PolymorphicProps> { children: string; maxLines?: number; refProp?: string; /** * Using this prop may introduce accessibility issues by hiding content from the user. * Only use this prop if you have an alternative way to make the full text accessible. */ hideTooltip?: boolean; onOverflowChange?: (hasOverflow: boolean) => void; } interface TextEllipsisWithTooltipProps extends TextEllipsisBaseProps { tooltipProps?: Omit; } interface TextEllipsisWithoutTooltipProps extends TextEllipsisBaseProps { tooltipProps: never; /** Prevent TextEllipsis from showing a tooltip when the text is ellipsized. */ hideTooltip: true; } declare const TextEllipsis: PolymorphicComponent; export default TextEllipsis;