FIXED: Interfaces

This commit is contained in:
2024-02-01 22:39:27 +04:00
parent 218b8f61d6
commit 43381e4a7b
11 changed files with 28 additions and 33 deletions

View File

@@ -19,17 +19,10 @@ interface RippleEventHandlers {
onTouchStart: TouchEventHandler;
}
export type InteractionEventsType = MouseEvent & TouchEvent & DragEvent & FocusEvent
export interface InteractionEvents<T>
extends MouseEvent,
TouchEvent,
DragEvent,
FocusEvent,
MouseEventHandler<T>,
DragEventHandler<T>,
FocusEventHandler<T>,
TouchEventHandler<T> {}
export type InteractionEventsType = MouseEvent &
TouchEvent &
DragEvent &
FocusEvent;
const UseRippleEffect = (ref, callback): undefined | RippleEventHandlers => {
const [mounted, setMounted] = useState<boolean>(false);

View File

@@ -11,7 +11,7 @@ import React, {
import { Ripple } from './ripple';
import { Ripples } from './ripple';
import { RippleAreaProps } from './ripple.types';
import {InteractionEvents, InteractionEventsType} from './hooks/useRippleEffect';
import { InteractionEventsType } from './hooks/useRippleEffect';
const TIMEOUT: number = 550;
const rippleAreaContext = React.createContext(false);

View File

@@ -4,7 +4,7 @@ export interface RipplesProps extends HTMLAttributes<HTMLElement> {
children?: ReactElement[];
}
export interface IRippleProps extends HTMLAttributes<HTMLElement> {
export interface RipplePropsForComponents<T> extends HTMLAttributes<T> {
centralRipple?: boolean;
}