Skip to content

Commit ec1216f

Browse files
committed
Fix arrowPlacement and arrowStyle to latest API
1 parent 9c9ccd6 commit ec1216f

File tree

1 file changed

+51
-48
lines changed

1 file changed

+51
-48
lines changed

index.d.ts

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,72 +7,75 @@ declare module 'react-popper-tooltip' {
77
import Popper from 'popper.js';
88

99
type GetTriggerProps = (
10-
props?: {
11-
onClick?: (evt: React.SyntheticEvent) => void;
12-
onContextMenu?: (evt: React.SyntheticEvent) => void;
13-
onMouseEnter?: (evt: React.SyntheticEvent) => void;
14-
onMouseLeave?: (evt: React.SyntheticEvent) => void;
15-
[key: string]: any;
16-
}
17-
) => {
18-
onClick: (evt: React.SyntheticEvent) => void;
19-
onContextMenu: (evt: React.SyntheticEvent) => void;
20-
onMouseEnter: (evt: React.SyntheticEvent) => void;
21-
onMouseLeave: (evt: React.SyntheticEvent) => void;
10+
props?: {
11+
onClick?: (evt: React.SyntheticEvent) => void;
12+
onContextMenu?: (evt: React.SyntheticEvent) => void;
13+
onMouseEnter?: (evt: React.SyntheticEvent) => void;
14+
onMouseLeave?: (evt: React.SyntheticEvent) => void;
2215
[key: string]: any;
16+
}
17+
) => {
18+
onClick: (evt: React.SyntheticEvent) => void;
19+
onContextMenu: (evt: React.SyntheticEvent) => void;
20+
onMouseEnter: (evt: React.SyntheticEvent) => void;
21+
onMouseLeave: (evt: React.SyntheticEvent) => void;
22+
[key: string]: any;
2323
};
2424

2525
export default class TooltipTrigger extends React.PureComponent<Props, {}> {
26-
showTooltip(): void;
26+
showTooltip(): void;
2727

28-
hideTooltip(): void;
28+
hideTooltip(): void;
2929

30-
toggleTooltip(): void;
30+
toggleTooltip(): void;
3131

32-
scheduleShow(): void;
32+
scheduleShow(): void;
3333

34-
scheduleHide(): void;
34+
scheduleHide(): void;
3535

36-
scheduleToggle(): void;
36+
scheduleToggle(): void;
3737

38-
getTriggerProps: GetTriggerProps;
38+
getTriggerProps: GetTriggerProps;
3939
}
4040

4141
interface ChildProps {
42-
getTriggerProps: GetTriggerProps;
43-
triggerRef: React.RefObject<any>;
42+
getTriggerProps: GetTriggerProps;
43+
triggerRef: React.RefObject<any>;
4444
}
4545

4646
interface TooltipProps {
47-
getTooltipProps: (
48-
props?: {
49-
style?: React.CSSProperties;
50-
onMouseLeave?: (evt: React.SyntheticEvent) => void;
51-
onMouseEnter?: (evt: React.SyntheticEvent) => void;
52-
[key: string]: any;
53-
}
54-
) => {
55-
style: React.CSSProperties;
56-
onMouseEnter: (evt: React.SyntheticEvent) => void;
57-
onMouseLeave: (evt: React.SyntheticEvent) => void;
58-
[key: string]: any;
59-
};
60-
tooltipRef: React.RefObject<any>;
61-
arrowStyle: () => React.CSSProperties;
62-
arrowRef: React.RefObject<any>;
63-
arrowPlacement: Popper.Placement;
47+
getTooltipProps: (
48+
props?: {
49+
style?: React.CSSProperties;
50+
onMouseLeave?: (evt: React.SyntheticEvent) => void;
51+
onMouseEnter?: (evt: React.SyntheticEvent) => void;
52+
[key: string]: any;
53+
}
54+
) => {
55+
style: React.CSSProperties;
56+
onMouseEnter: (evt: React.SyntheticEvent) => void;
57+
onMouseLeave: (evt: React.SyntheticEvent) => void;
58+
[key: string]: any;
59+
};
60+
tooltipRef: React.RefObject<any>;
61+
getArrowProps: (props: any) => {
62+
style: React.CSSProperties;
63+
[key: string]: any;
64+
};
65+
arrowRef: React.RefObject<any>;
66+
placement: Popper.Placement;
6467
}
6568

6669
export interface Props {
67-
tooltip: (props: TooltipProps) => JSX.Element;
68-
children: (props: ChildProps) => JSX.Element;
69-
defaultTooltipShown?: boolean;
70-
tooltipShown?: boolean;
71-
delayShow?: number;
72-
delayHide?: number;
73-
trigger?: 'click' | 'hover' | 'right-click' | 'none';
74-
closeOnOutOfBoundaries?: boolean;
75-
modifiers?: Popper.Modifiers;
76-
placement?: Popper.Placement;
70+
tooltip: (props: TooltipProps) => JSX.Element;
71+
children: (props: ChildProps) => JSX.Element;
72+
defaultTooltipShown?: boolean;
73+
tooltipShown?: boolean;
74+
delayShow?: number;
75+
delayHide?: number;
76+
trigger?: 'click' | 'hover' | 'right-click' | 'none';
77+
closeOnOutOfBoundaries?: boolean;
78+
modifiers?: Popper.Modifiers;
79+
placement?: Popper.Placement;
7780
}
7881
}

0 commit comments

Comments
 (0)