/**
 * InteractionManager class for interaction handling.
 *
 * @class
 * @memberof Scuti
 */
export class InteractionManager {
    constructor() {
        /**
         * A boolean indicating if the user have clicked at least one time, indicating that the second click is a double click.
         *
         * @member {boolean}
         * @private
         */
        this._isDoubleClicking = false;
    }
    /**
     * Reference to the pointer down event.
     *
     * @member {(event: IInteractionEvent) => void}
     * @readonly
     * @public
     */
    get onPointerDown() {
        return this._onPointerDown;
    }
    /**
     * Update the event function that will be executed.
     *
     * @param {(event: IInteractionEvent) => void} [value] - The event function that will be executed.
     * @public
     */
    set onPointerDown(value) {
        this._onPointerDown = value;
    }
    /**
     * Reference to the pointer up event.
     *
     * @member {(event: IInteractionEvent) => void}
     * @readonly
     * @public
     */
    get onPointerUp() {
        return this._onPointerUp;
    }
    /**
     * Update the event function that will be executed.
     *
     * @param {(event: IInteractionEvent) => void} [value] - The event function that will be executed.
     * @public
     */
    set onPointerUp(value) {
        this._onPointerUp = value;
    }
    /**
     * Reference to the pointer move event.
     *
     * @member {(event: IInteractionEvent) => void}
     * @readonly
     * @public
     */
    get onPointerMove() {
        return this._onPointerMove;
    }
    /**
     * Update the event function that will be executed.
     *
     * @param {(event: IInteractionEvent) => void} [value] - The event function that will be executed.
     * @public
     */
    set onPointerMove(value) {
        this._onPointerMove = value;
    }
    /**
     * Reference to the pointer out event.
     *
     * @member {(event: IInteractionEvent) => void}
     * @readonly
     * @public
     */
    get onPointerOut() {
        return this._onPointerOut;
    }
    /**
     * Update the event function that will be executed.
     *
     * @param {(event: IInteractionEvent) => void} [value] - The event function that will be executed.
     * @public
     */
    set onPointerOut(value) {
        this._onPointerOut = value;
    }
    /**
     * Reference to the pointer over event.
     *
     * @member {(event: IInteractionEvent) => void}
     * @readonly
     * @public
     */
    get onPointerOver() {
        return this._onPointerOver;
    }
    /**
     * Update the event function that will be executed.
     *
     * @param {(event: IInteractionEvent) => void} [value] - The event function that will be executed.
     * @public
     */
    set onPointerOver(value) {
        this._onPointerOver = value;
    }
    /**
     * Reference to the pointer double click event.
     *
     * @member {(event: IInteractionEvent) => void}
     * @readonly
     * @public
     */
    get onDoubleClick() {
        return this._onDoubleClick;
    }
    /**
     * Update the event function that will be executed.
     *
     * @param {(event: IInteractionEvent) => void} [value] - The event function that will be executed.
     * @public
     */
    set onDoubleClick(value) {
        this._onDoubleClick = value;
    }
    /**
     * Handle the pointer down event.
     *
     * @return {void}
     * @public
     */
    handlePointerDown(event) {
        if (!this._isDoubleClicking) {
            if (this.onPointerDown !== undefined)
                this._onPointerDown(event);
            this._isDoubleClicking = true;
            this._doubleClickTimeout = window.setTimeout(() => this._isDoubleClicking = false, 350);
        }
        else {
            if (this.onDoubleClick !== undefined)
                this._onDoubleClick(event);
            this._isDoubleClicking = false;
            window.clearTimeout(this._doubleClickTimeout);
        }
    }
    /**
     * Handle the pointer up event.
     *
     * @return {void}
     * @public
     */
    handlePointerUp(event) {
        if (this.onPointerUp !== undefined)
            this._onPointerUp(event);
    }
    /**
     * Handle the pointer move event.
     *
     * @return {void}
     * @public
     */
    handlePointerMove(event) {
        if (this.onPointerMove !== undefined)
            this._onPointerMove(event);
    }
    /**
     * Handle the pointer out event.
     *
     * @return {void}
     * @public
     */
    handlePointerOut(event) {
        if (this.onPointerOut !== undefined)
            this._onPointerOut(event);
    }
    /**
     * Handle the pointer over event.
     *
     * @return {void}
     * @public
     */
    handlePointerOver(event) {
        if (this.onPointerOver !== undefined)
            this._onPointerOver(event);
    }
}
//# sourceMappingURL=InteractionManager.js.map