1 | import * as React from 'react';
|
2 |
|
3 | import { TransitionCallbacks } from './helpers';
|
4 |
|
5 | type ComponentOrElement = React.ReactInstance | Node;
|
6 | export type Placement =
|
7 | | 'auto-start'
|
8 | | 'auto'
|
9 | | 'auto-end'
|
10 | | 'top-start'
|
11 | | 'top'
|
12 | | 'top-end'
|
13 | | 'right-start'
|
14 | | 'right'
|
15 | | 'right-end'
|
16 | | 'bottom-end'
|
17 | | 'bottom'
|
18 | | 'bottom-start'
|
19 | | 'left-end'
|
20 | | 'left'
|
21 | | 'left-start';
|
22 |
|
23 | export interface OverlayInjectedProps {
|
24 | show: boolean;
|
25 | arrowProps: Record<string, any>;
|
26 | popper: {
|
27 | state: any;
|
28 | outOfBoundaries: boolean;
|
29 | placement: Placement;
|
30 | scheduleUpdate: () => void;
|
31 | };
|
32 | [prop: string]: any;
|
33 | }
|
34 |
|
35 | export type OverlayChildren =
|
36 | | React.ReactElement<OverlayInjectedProps>
|
37 | | ((injected: OverlayInjectedProps) => React.ReactNode);
|
38 |
|
39 | export interface OverlayProps extends TransitionCallbacks {
|
40 | children: OverlayChildren;
|
41 | container?: ComponentOrElement | ((props: object) => ComponentOrElement);
|
42 | target?: ComponentOrElement | ((props: object) => ComponentOrElement);
|
43 | show?: boolean;
|
44 | popperConfig?: object;
|
45 | rootClose?: boolean;
|
46 | rootCloseEvent?: 'click' | 'mousedown';
|
47 | onHide?: (event: React.SyntheticEvent) => void;
|
48 | transition?: boolean | React.ElementType;
|
49 | placement?: Placement;
|
50 | }
|
51 |
|
52 | declare class Overlay extends React.Component<OverlayProps> {}
|
53 |
|
54 | export default Overlay;
|