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.

60 lines (59 loc) 2.25 kB
import Component from "@egjs/component"; import { ReactiveSubscribe } from "@cfcs/core"; import { EventManager } from "./EventManager"; import { InterruptManager } from "./InterruptManager"; import { AxisManager, AxisOption, Axis } from "./AxisManager"; import { InputObserver } from "./InputObserver"; import { InputType } from "./inputType/InputType"; import { AxesEvents, AxesReactiveState, ObjectInterface, UpdateAnimationOption } from "./types"; import { AnimationManager } from "./animation/AnimationManager"; export interface AxesOption { easing?: (x: number) => number; maximumDuration?: number; minimumDuration?: number; deceleration?: number; interruptable?: boolean; round?: number; nested?: boolean; } declare class Axes extends Component<AxesEvents> { axis: ObjectInterface<AxisOption>; static VERSION: string; static PanInput: any; static PinchInput: any; static WheelInput: any; static MoveKeyInput: any; static RotatePanInput: any; static TRANSFORM: string; static DIRECTION_NONE: number; static DIRECTION_LEFT: number; static DIRECTION_RIGHT: number; static DIRECTION_UP: number; static DIRECTION_DOWN: number; static DIRECTION_HORIZONTAL: number; static DIRECTION_VERTICAL: number; static DIRECTION_ALL: number; get holding(): boolean; options: AxesOption; eventManager: EventManager; axisManager: AxisManager; interruptManager: InterruptManager; animationManager: AnimationManager; inputObserver: InputObserver; private _inputs; constructor(axis?: ObjectInterface<AxisOption>, options?: AxesOption, startPos?: Axis); connect(axes: string[] | string, inputType: InputType): this; disconnect(inputType?: InputType): this; get(axes?: string[]): Axis; setTo(pos: Axis, duration?: number): this; setBy(pos: Axis, duration?: number): this; setOptions(options: AxesOption): this; setAxis(axis: ObjectInterface<AxisOption>): this; stopAnimation(): this; updateAnimation(options: UpdateAnimationOption): this; isBounceArea(axes?: string[]): boolean; destroy(): void; } interface Axes extends AxesReactiveState, ReactiveSubscribe<AxesReactiveState> { } export default Axes;