diff --git a/types/react-onclickoutside/index.d.ts b/types/react-onclickoutside/index.d.ts index b37a6ac025..0e4d51edda 100644 --- a/types/react-onclickoutside/index.d.ts +++ b/types/react-onclickoutside/index.d.ts @@ -6,38 +6,33 @@ import * as React from 'react'; -declare namespace ClickOut { +declare namespace OnClickOut { interface HandleClickOutside { handleClickOutside: React.MouseEventHandler; } - interface InjectedProps { + interface InjectedOnClickOutProps { disableOnClickOutside(): void; enableOnClickOutside(): void; } - interface Props { - disableOnClickOutside: boolean; - eventTypes: string | string[]; - outsideClickIgnoreClass: string; - preventDefault: boolean; - stopPropagation: boolean; + interface OnClickOutProps { + disableOnClickOutside?: boolean; + eventTypes?: string | string[]; + outsideClickIgnoreClass?: string; + preventDefault?: boolean; + stopPropagation?: boolean; } } -/** - * Wraps a React.Stateless or React.Component with clickout - * Must pass handleClickOutside as a prop or implement ClickOut.HandleClickOutside - * @param component - * @constructor - */ -declare function ClickOut( - component: Stateless | Component -): React.ComponentClass>; +type DecoratedComponent

= React.ComponentClass

; -type Stateless = React.StatelessComponent>; +declare function OnClickOut

( + component: React.StatelessComponent

> +): DecoratedComponent

; -type Component = React.ComponentClass | - React.ComponentClass>; +declare function OnClickOut

( + component: React.ComponentClass

>> +): DecoratedComponent

; -export = ClickOut; +export = OnClickOut;