"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeUIEventListener = exports.UI_EVENT_SET = void 0;
const change_1 = require("./event/change");
const input_1 = require("./event/input");
const keyboard_1 = require("./event/keyboard");
const paste_1 = require("./event/paste");
const click_1 = require("./event/pointer/click");
const pointerdown_1 = require("./event/pointer/pointerdown");
const pointerenter_1 = require("./event/pointer/pointerenter");
const pointerleave_1 = require("./event/pointer/pointerleave");
const pointermove_1 = require("./event/pointer/pointermove");
const pointerup_1 = require("./event/pointer/pointerup");
const wheel_1 = require("./event/wheel");
exports.UI_EVENT_SET = new Set([
    'click',
    'dbclick',
    'longpress',
    'longclick',
    'pointerdown',
    'pointermove',
    'pointerup',
    'pointerenter',
    'pointerleave',
    'input',
    'change',
    'paste',
    'keydown',
    'keyup',
    'keypress',
    'wheel',
]);
function makeUIEventListener(event, callback) {
    switch (event) {
        case 'click':
            return (0, click_1.makeClickListener)({ onClick: callback });
        case 'dbclick':
            return (0, click_1.makeClickListener)({ onDoubleClick: callback });
        case 'longpress':
            return (0, click_1.makeClickListener)({ onLongPress: callback });
        case 'longclick':
            return (0, click_1.makeClickListener)({ onLongClick: callback });
        case 'pointerdown':
            return (0, pointerdown_1.makePointerDownListener)(callback);
        case 'pointermove':
            return (0, pointermove_1.makePointerMoveListener)(callback);
        case 'pointerup':
            return (0, pointerup_1.makePointerUpListener)(callback);
        case 'pointerenter':
            return (0, pointerenter_1.makePointerEnterListener)(callback);
        case 'pointerleave':
            return (0, pointerleave_1.makePointerLeaveListener)(callback);
        case 'input':
            return (0, input_1.makeInputListener)(callback);
        case 'change':
            return (0, change_1.makeChangeListener)(callback);
        case 'paste':
            return (0, paste_1.makePasteListener)(callback);
        case 'keydown':
            return (0, keyboard_1.makeKeydownListener)(callback);
        case 'keyup':
            return (0, keyboard_1.makeKeyupListener)(callback);
        case 'keypress':
            return (0, keyboard_1.makeKeypressListener)(callback);
        case 'wheel':
            return (0, wheel_1.makeWheelListener)(callback);
        default:
            throw new Error(`Unknown UI event: ${event}`);
    }
}
exports.makeUIEventListener = makeUIEventListener;
//# sourceMappingURL=makeEventListener.js.map