UNPKG

1.31 kBTypeScriptView Raw
1import * as React from 'react';
2
3import { TransitionCallbacks } from './helpers';
4
5type ComponentOrElement = React.ReactInstance | Node;
6export 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
23export 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
35export type OverlayChildren =
36 | React.ReactElement<OverlayInjectedProps>
37 | ((injected: OverlayInjectedProps) => React.ReactNode);
38
39export 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
52declare class Overlay extends React.Component<OverlayProps> {}
53
54export default Overlay;