1 | import * as React from 'react';
|
2 | import { TooltipProps as RcTooltipProps } from 'rc-tooltip/lib/Tooltip';
|
3 | import { placements as Placements } from 'rc-tooltip/lib/placements';
|
4 | import { AdjustOverflow, PlacementsConfig } from './placements';
|
5 | import { PresetColorType } from '../_util/colors';
|
6 | import { LiteralUnion } from '../_util/type';
|
7 | export { AdjustOverflow, PlacementsConfig };
|
8 | export declare type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
9 | export interface TooltipAlignConfig {
|
10 | points?: [string, string];
|
11 | offset?: [number | string, number | string];
|
12 | targetOffset?: [number | string, number | string];
|
13 | overflow?: {
|
14 | adjustX: boolean;
|
15 | adjustY: boolean;
|
16 | };
|
17 | useCssRight?: boolean;
|
18 | useCssBottom?: boolean;
|
19 | useCssTransform?: boolean;
|
20 | }
|
21 | export interface AbstractTooltipProps extends Partial<Omit<RcTooltipProps, 'children'>> {
|
22 | style?: React.CSSProperties;
|
23 | className?: string;
|
24 | color?: LiteralUnion<PresetColorType, string>;
|
25 | placement?: TooltipPlacement;
|
26 | builtinPlacements?: typeof Placements;
|
27 | openClassName?: string;
|
28 | arrowPointAtCenter?: boolean;
|
29 | autoAdjustOverflow?: boolean | AdjustOverflow;
|
30 | getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
31 | children?: React.ReactNode;
|
32 | }
|
33 | export declare type RenderFunction = () => React.ReactNode;
|
34 | export interface TooltipPropsWithOverlay extends AbstractTooltipProps {
|
35 | title?: React.ReactNode | RenderFunction;
|
36 | overlay: React.ReactNode | RenderFunction;
|
37 | }
|
38 | export interface TooltipPropsWithTitle extends AbstractTooltipProps {
|
39 | title: React.ReactNode | RenderFunction;
|
40 | overlay?: React.ReactNode | RenderFunction;
|
41 | }
|
42 | export declare type TooltipProps = TooltipPropsWithTitle | TooltipPropsWithOverlay;
|
43 | declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<unknown>>;
|
44 | export default Tooltip;
|