import ButtonInputControl, { ButtonInputControlOptions } from '../controls/ButtonInputControl'; import AxisInputControl from '../controls/AxisInputControl'; import Vector2InputControl, { Vector2InputControlOptions } from '../controls/Vector2InputControl'; import { ThrottledDevice, ThrottledDeviceOptions } from '../Device'; import { InputControlOptions } from '../controls/InputControl'; declare const buttonNameDefs: { leftMouseButton: { device: string; index: number; }; touch: { device: string; index: number; }; penTip: { device: string; index: number; }; middleMouseButton: { device: string; index: number; }; rightMouseButton: { device: string; index: number; }; penBarrelButton: { device: string; index: number; }; mouseBackButton: { device: string; index: number; }; mouseForwardButton: { device: string; index: number; }; penEraser: { device: string; index: number; }; }; declare const controlDefs: { readonly position: { readonly constructor: typeof Vector2InputControl; readonly reader: (evt: any) => [number, number]; }; readonly pagePosition: { readonly constructor: typeof Vector2InputControl; readonly reader: (evt: any) => [number, number]; }; readonly screenPosition: { readonly constructor: typeof Vector2InputControl; readonly reader: (evt: any) => [number, number]; }; readonly tilt: { readonly constructor: typeof Vector2InputControl; readonly reader: (evt: any) => number[]; }; readonly contact: { readonly constructor: typeof Vector2InputControl; readonly reader: (evt: any) => any[]; }; readonly delta: { readonly constructor: typeof Vector2InputControl; readonly reader: (evt: any, previousEvent: any, defaultValue: any) => any; }; readonly pageDelta: { readonly constructor: typeof Vector2InputControl; readonly reader: (evt: any, previousEvent: any, defaultValue: any) => any; }; readonly screenDelta: { readonly constructor: typeof Vector2InputControl; readonly reader: (evt: any, previousEvent: any, defaultValue: any) => any; }; }; export interface PointerDeviceOptions extends ThrottledDeviceOptions { element?: HTMLElement; /** * whether to respond to touch pointer events * default: `true` * */ touch?: boolean; /** * whether to respond to pen pointer events * default: `true` * */ pen?: boolean; /** * whether to respond to mouse pointer events * default: `false` * */ mouse?: boolean; touchActionStyle?: boolean; } /** * A Pointer device driven by the [Pointer Events API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) * and supporting multiple pointer types: mouse, touch or pen. * * Input is throttled to the `updatePeriod` given the constructor options, * which defaults to 1 / 60th of a second. * * Currently, only a single pointer is handled at a time, i.e. the first finger * to touch. */ export default class Pointer extends ThrottledDevice { readonly pointerType: 'pen' | 'mouse' | 'touch' | ''; getControl: { /** Two-dimensional vectors */ (name: keyof typeof controlDefs, options?: Vector2InputControlOptions): Vector2InputControl; /** Pointer device buttons */ (name: keyof typeof buttonNameDefs, options?: ButtonInputControlOptions): ButtonInputControl; /** Normalized pressure of the [pointer](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure) input */ (name: 'pressure', options?: InputControlOptions): AxisInputControl; /** Two-dimensional change in pointer 'wheel', typically on a mouse or touchpad */ (name: 'wheel', options?: Vector2InputControlOptions): Vector2InputControl; }; constructor(options?: PointerDeviceOptions); } export {};