UNPKG

2.95 kBTypeScriptView Raw
1/**
2 * @fileOverview Tooltip
3 */
4import React, { PureComponent, CSSProperties, ReactNode, ReactElement, SVGProps } from 'react';
5import { ValueType, NameType, Payload, Props as ToltipContentProps } from './DefaultTooltipContent';
6import { UniqueOption } from '../util/payload/getUniqPayload';
7import { AllowInDimension, AnimationDuration, AnimationTiming, CartesianViewBox, Coordinate } from '../util/types';
8export type ContentType<TValue extends ValueType, TName extends NameType> = ReactElement | ((props: TooltipProps<TValue, TName>) => ReactNode);
9export type TooltipProps<TValue extends ValueType, TName extends NameType> = ToltipContentProps<TValue, TName> & {
10 accessibilityLayer?: boolean;
11 /**
12 * If true, then Tooltip is always displayed, once an activeIndex is set by mouse over, or programmatically.
13 * If false, then Tooltip is never displayed.
14 * If active is undefined, Recharts will control when the Tooltip displays. This includes mouse and keyboard controls.
15 */
16 active?: boolean | undefined;
17 /**
18 * If true, then Tooltip will information about hidden series (defaults to false). Interacting with the hide property of Area, Bar, Line, Scatter.
19 */
20 includeHidden?: boolean | undefined;
21 allowEscapeViewBox?: AllowInDimension;
22 animationDuration?: AnimationDuration;
23 animationEasing?: AnimationTiming;
24 content?: ContentType<TValue, TName>;
25 coordinate?: Partial<Coordinate>;
26 cursor?: boolean | ReactElement | SVGProps<SVGElement>;
27 filterNull?: boolean;
28 defaultIndex?: number;
29 isAnimationActive?: boolean;
30 offset?: number;
31 payloadUniqBy?: UniqueOption<Payload<TValue, TName>>;
32 position?: Partial<Coordinate>;
33 reverseDirection?: AllowInDimension;
34 shared?: boolean;
35 trigger?: 'hover' | 'click';
36 useTranslate3d?: boolean;
37 viewBox?: CartesianViewBox;
38 wrapperStyle?: CSSProperties;
39};
40export declare class Tooltip<TValue extends ValueType, TName extends NameType> extends PureComponent<TooltipProps<TValue, TName>> {
41 static displayName: string;
42 static defaultProps: {
43 accessibilityLayer: boolean;
44 allowEscapeViewBox: {
45 x: boolean;
46 y: boolean;
47 };
48 animationDuration: number;
49 animationEasing: string;
50 contentStyle: {};
51 coordinate: {
52 x: number;
53 y: number;
54 };
55 cursor: boolean;
56 cursorStyle: {};
57 filterNull: boolean;
58 isAnimationActive: boolean;
59 itemStyle: {};
60 labelStyle: {};
61 offset: number;
62 reverseDirection: {
63 x: boolean;
64 y: boolean;
65 };
66 separator: string;
67 trigger: string;
68 useTranslate3d: boolean;
69 viewBox: {
70 x: number;
71 y: number;
72 height: number;
73 width: number;
74 };
75 wrapperStyle: {};
76 };
77 render(): React.JSX.Element;
78}
79
\No newline at end of file