UNPKG

1.47 kBTypeScriptView Raw
1// Type definitions for react-popper 1.0.0-beta.6
2// Project: https://github.com/gilbarbara/react-joyride
3
4declare module 'react-popper' {
5 import * as React from 'react';
6 import * as PopperJS from 'popper.js';
7
8 interface ManagerProps {
9 children: React.ReactNode;
10 }
11 export class Manager extends React.Component<ManagerProps, {}> {}
12
13 type RefHandler = (ref: HTMLElement | null) => void;
14
15 export interface ReferenceChildrenProps {
16 ref: RefHandler;
17 }
18
19 export interface ReferenceProps {
20 children: (props: ReferenceChildrenProps) => React.ReactNode;
21 }
22 export class Reference extends React.Component<ReferenceProps, {}> {}
23
24 export interface PopperArrowProps {
25 ref: RefHandler;
26 style: React.CSSProperties;
27 }
28
29 export type Placement = PopperJS.Placement;
30
31 export interface PopperChildrenProps {
32 arrowProps: PopperArrowProps;
33 outOfBoundaries: boolean | null;
34 placement: PopperJS.Placement;
35 ref: RefHandler;
36 scheduleUpdate: () => void;
37 style: React.CSSProperties;
38 }
39
40 export interface PopperProps {
41 children: (props: PopperChildrenProps) => React.ReactNode;
42 eventsEnabled?: boolean;
43 modifiers?: PopperJS.Modifiers;
44 placement?: PopperJS.Placement;
45 positionFixed?: boolean;
46 referenceElement?: Element;
47 }
48 export class Popper extends React.Component<PopperProps, {}> {}
49}