UNPKG

@egjs/axes

Version:

A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.

29 lines (28 loc) 1.04 kB
import { ObjectInterface } from "./types"; export interface Axis { [key: string]: number; } export interface AxisOption { range?: number[]; bounce?: number | number[]; circular?: boolean | boolean[]; startPos?: number; } export declare class AxisManager { private _axis; private _pos; constructor(_axis: ObjectInterface<AxisOption>); getDelta(depaPos: Axis, destPos: Axis): Axis; get(axes?: string[] | Axis): Axis; moveTo(pos: Axis, depaPos?: Axis): { [key: string]: Axis; }; set(pos: Axis): void; every(pos: Axis, callback: (value: number, options: AxisOption, key: string) => boolean): boolean; filter(pos: Axis, callback: (value: number, options: AxisOption, key: string) => boolean): Axis; map<U>(pos: Axis, callback: (value: number, options: AxisOption, key: string) => U): ObjectInterface<U>; isOutside(axes?: string[]): boolean; getAxisOptions(key: string): AxisOption; setAxis(axis: ObjectInterface<AxisOption>): void; private _complementOptions; }