@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.
27 lines (26 loc) • 977 B
TypeScript
import { Axis } from "../AxisManager";
import { AxesOption } from "../Axes";
import { ActiveEvent } from "../types";
export interface InputType {
axes: string[];
element: HTMLElement;
mapAxes(axes: string[]): any;
connect(observer: InputTypeObserver): InputType;
disconnect(): any;
destroy(): any;
enable?(): any;
disable?(): any;
isEnable?(): boolean;
}
export interface InputTypeObserver {
options: AxesOption;
get(inputType: InputType): Axis;
change(inputType: InputType, event: any, offset: Axis, useAnimation?: boolean): any;
hold(inputType: InputType, event: any): any;
release(inputType: InputType, event: any, velocity: number[], inputDuration?: number): any;
}
export declare const toAxis: (source: string[], offset: number[]) => Axis;
export declare const convertInputType: (inputType?: string[]) => ActiveEvent;
export declare function getAddEventOptions(eventName: string): false | {
passive: boolean;
};