@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
44 lines (43 loc) • 2.19 kB
TypeScript
import { Object3D } from 'three';
import { Constructor, ConvertToStrings } from '../../../../../types/GlobalTypes';
import { BaseRayObjectIntersectionsController } from './_BaseRayObjectIntersectionsController';
import { ObjectOptions, GPUOptions, CPUOptions, PriorityOptions, ButtonAndModifierOptions, ButtonAndModifierOptionsAsString } from './Common';
interface LongPressOptions {
duration: number;
maxCursorMoveDistance: number;
callback: () => void;
}
export interface ObjectToLongPressOptions extends ObjectOptions {
longPress: LongPressOptions;
config: ButtonAndModifierOptions;
}
export interface ObjectToLongPressOptionsAsString {
priority: ConvertToStrings<PriorityOptions>;
cpu?: ConvertToStrings<CPUOptions>;
gpu?: ConvertToStrings<GPUOptions>;
longPress: ConvertToStrings<LongPressOptions>;
config: ButtonAndModifierOptionsAsString;
}
export declare const DEFAULT_LONG_PRESS_DURATION = 500;
export declare const DEFAULT_MAX_CURSOR_MOVE_DISTANCE = 0.05;
export declare function LongPressParamConfig<TBase extends Constructor>(Base: TBase): {
new (...args: any[]): {
/** @param press duration (in milliseconds) */
duration: import("../../../../nodes/utils/params/ParamsConfig").ParamTemplate<import("../../../../index_all").ParamType.INTEGER>;
/** @param max cursor move distance */
maxCursorMoveDistance: import("../../../../nodes/utils/params/ParamsConfig").ParamTemplate<import("../../../../index_all").ParamType.FLOAT>;
};
} & TBase;
export declare class RayObjectIntersectionsLongPressController extends BaseRayObjectIntersectionsController {
protected _propertiesListByObject: Map<Object3D, ObjectToLongPressOptions[]>;
protected _intersectedStateOnPointerdownByObject: Map<Object3D, boolean>;
protected _intersectedStateOnTimeoutByObject: Map<Object3D, boolean>;
private _objectsMatchingEventConfig;
protected _objectsByLongPressDuration: Map<number, Object3D[]>;
private _timerByDuration;
private _cursorMoveMonitor;
private _bound;
onPointerdown(event: Readonly<PointerEvent | MouseEvent | TouchEvent>): void;
private _onPointerup;
}
export {};