UNPKG

react-easy-diagram

Version:

<img src="https://github.com/tokarchyn/react-easy-diagram/blob/main/repo/logo-with-name.png?raw=true" alt="React Easy Diagram logo" height="50">

28 lines 1.68 kB
import { AnyHandlerEventTypes, EventTypes, GestureKey, NativeHandlers, UserHandlers, Vector2 } from '@use-gesture/react'; import { Point } from "../../utils/point"; /** * Check each element starting from the first one in composedPath() (see https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath), * if exceptClassName is the first class found -> return false, * if className is the first class found -> return true, * if neither exceptClassName nor className were found -> return false */ export declare const eventPathContainsClass: (event: PointerEvent | TouchEvent | MouseEvent | KeyboardEvent, className: string, exceptClassName?: string | undefined) => boolean; /** * Does gesture can be potentially a tap/click event? * Drag gesture will be tap/click gesture on mouse or touch release only when the drag displacement is inferior to 3 pixels. * See useGestures documentation for more information. * @param movement - state value of gesture, represent gesture offset */ export declare function canDragGestureBeTapInstead(movement: Vector2): boolean; export interface IUserInteractionTranslate { offset: Point; setOffset: (newOffset: Point) => any; } export interface IUserInteractionTranslateAndZoom { offset: Point; zoom: number; translateAndZoomInto: (translateBy: Point, pointToZoomInto: Point, changeZoomBy: number) => any; } export declare type GestureHandlers = Partial<UserHandlers<EventTypes> & NativeHandlers<EventTypes>>; export declare type check<T extends AnyHandlerEventTypes, Key extends GestureKey> = undefined extends T[Key] ? EventTypes[Key] : T[Key]; //# sourceMappingURL=common.d.ts.map