DefinitelyTyped/types/react-outside-click-handler/index.d.ts
Ivan Zub 939bed73a7 Add type definitions for airbnb/react-outside-click-handler (#29471)
* Add type definitions for react-outside-click-handler

* Fix tests and fallback to TS 2.9

DT is not supporting typescript 3 yet, so can't properly use defaultProps
2018-10-05 11:29:26 -07:00

24 lines
830 B
TypeScript

// Type definitions for react-outside-click-handler 1.2
// Project: https://github.com/airbnb/react-outside-click-handler
// Definitions by: Ivan Zub <https://github.com/zubivan>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
import * as React from "react";
export interface DefaultProps {
disabled: boolean;
useCapture: boolean;
display: "block" | "flex" | "inline-block";
}
// TODO: Remove partial once DT support TS 3.0, so skipping mandatory listed in default props won't result in compile error
export interface Props extends Partial<DefaultProps> {
children: React.ReactNode;
onOutsideClick: (e: React.MouseEvent<HTMLElement>) => void;
}
export default class OutsideClickHandler extends React.Component<Props> {
static defaultProps: DefaultProps;
}