6.7.10 • Published 1 month ago

@types/react-onclickoutside v6.7.10

Weekly downloads
50,292
License
MIT
Repository
github
Last release
1 month ago

Installation

npm install --save @types/react-onclickoutside

Summary

This package contains type definitions for react-onclickoutside (https://github.com/Pomax/react-onclickoutside).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-onclickoutside/v5.

index.d.ts

// Type definitions for react-onclickoutside 5.7
// Project: https://github.com/Pomax/react-onclickoutside
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import * as React from 'react';

declare namespace OnClickOut {
    interface HandleClickOutside<T> {
        handleClickOutside: React.MouseEventHandler<T>;
    }

    interface InjectedOnClickOutProps {
        disableOnClickOutside(): void;
        enableOnClickOutside(): void;
    }

    interface OnClickOutProps {
        disableOnClickOutside?: boolean | undefined;
        eventTypes?: string | string[] | undefined;
        outsideClickIgnoreClass?: string | undefined;
        preventDefault?: boolean | undefined;
        stopPropagation?: boolean | undefined;
    }
}

type ComponentConstructor<P> = React.ComponentClass<P> | React.FunctionComponent<P>;
interface ClickOutComponentClass<P extends OnClickOut.InjectedOnClickOutProps> extends React.ComponentClass<P> {
    new (props?: P, context?: any): React.Component<P, React.ComponentState> & OnClickOut.HandleClickOutside<any>;
}

declare function OnClickOut<P>(
    component: ComponentConstructor<P & OnClickOut.InjectedOnClickOutProps & OnClickOut.HandleClickOutside<any>>
        | ClickOutComponentClass<P & OnClickOut.InjectedOnClickOutProps>
): React.ComponentClass<P & OnClickOut.OnClickOutProps>;

export = OnClickOut;

Additional Details

  • Last updated: Wed, 20 Oct 2021 21:01:41 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Karol Janyst.