import { Vector } from './geometry'; import { Body, Filter, Constraint } from './body'; import { Engine } from './core'; /** * The`Matter.Mouse` module contains methods for creating and manipulating mouse inputs. * * @class Mouse */ export declare class Mouse { element: HTMLElement; absolute: Vector; position: Vector; mousedownPosition: Vector; mouseupPosition: Vector; offset: Vector; scale: Vector; wheelDelta: number; button: number; pixelRatio: number; mousemove: (e: any) => void; mousedown: (e: any) => void; mouseup: (e: any) => void; mousewheel: (e: any) => void; sourceEvents: { mousemove: null; mousedown: null; mouseup: null; mousewheel: null; }; /** * Creates a mouse input. * @method create * @param {HTMLElement} element * @return {mouse} A new mouse */ constructor(element: HTMLElement); /** * Sets the element the mouse is bound to (and relative to). * @method setElement * @param {mouse} this * @param {HTMLElement} element */ setElement(element: HTMLElement): void; /** * Clears all captured source events. * @method clearSourceEvents * @param {mouse} mouse */ clearSourceEvents(): void; /** * Sets the mouse position offset. * @method setOffset * @param {mouse} this * @param {vector} offset */ setOffset(offset: Vector): void; /** * Sets the mouse position scale. * @method setScale * @param {mouse} mouse * @param {vector} scale */ setScale(scale: Vector): void; /** * Gets the mouse position relative to an element given a screen pixel ratio. * @method _getRelativeMousePosition * @private * @param {} event * @param {} element * @param {number} pixelRatio * @return {} */ private static getRelativeMousePosition; } /** * The `Matter.MouseConstraint` module contains methods for creating mouse constraints. * Mouse constraints are used for allowing user interaction, providing the ability to move bodies via the mouse or touch. * * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). * * @class MouseConstraint */ export declare class MouseConstraint { constraint: Constraint; type: string; mouse: Mouse; element: HTMLElement | null; body: Body | null; collisionFilter: Filter; /** * Creates a new mouse constraint. * All properties have default values, and many are pre-calculated automatically based on other properties. * See the properties section below for detailed information on what you can pass via the `options` object. * @method create * @param {engine} engine * @param {} options * @return {MouseConstraint} A new MouseConstraint */ constructor(engine: Engine, options?: any); /** * Updates the given mouse constraint. * @private * @method update * @param {MouseConstraint} mouseConstraint * @param {body[]} bodies */ static update(mouseConstraint: MouseConstraint, bodies: Body[]): void; /** * Triggers mouse constraint events. * @method _triggerEvents * @private * @param {mouse} mouseConstraint */ private static triggerEvents; }