@mui/x-internal-gestures
Version:
The core engine of GestureEvents, a modern and robust multi-pointer gesture detection library for JavaScript.
53 lines • 1.11 kB
TypeScript
import { MousePointer } from "../types/Pointers.js";
export type MoveUserGestureOptions = {
/**
* The target element to start the move on.
*/
target: Element;
/**
* The pointer configuration to be used.
*/
pointer?: MousePointer;
/**
* The distance to move by in pixels.
*
* ```ts
* <=0 // No move
* >0 // Move
* ```
*/
distance: number;
/**
* The duration of the move in milliseconds.
*
* @default 500
*/
duration?: number;
/**
* The amount of steps to be performed.
*
* @default 10
*/
steps?: number;
/**
* The angle of the move in degrees.
*
* ```ts
* 0 // Horizontal move
* 90 // Vertical move
* 45 // Diagonal move
* ```
*
* @default 0
*/
angle?: number;
};
export type MoveUserGestureRoot = {
/**
* Sets up the move gesture with the given options.
*
* @param {MoveUserGestureOptions} options - Configuration for the move gesture
* @returns {Promise<void>} A promise that resolves when the gesture is complete
*/
move: (options: MoveUserGestureOptions) => Promise<void>;
};