"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UI_EVENT_SET = void 0;
exports.makeUIEventListener = makeUIEventListener;
const change_1 = require("./event/change");
const dragend_1 = require("./event/drag/dragend");
const dragover_1 = require("./event/drag/dragover");
const dragstart_1 = require("./event/drag/dragstart");
const drop_1 = require("./event/drag/drop");
const input_1 = require("./event/input");
const keyboard_1 = require("./event/keyboard");
const load_1 = require("./event/load");
const loadeddata_1 = require("./event/loadeddata");
const paste_1 = require("./event/paste");
const click_1 = require("./event/pointer/click");
const message_1 = require("./event/pointer/message");
const pointerdown_1 = require("./event/pointer/pointerdown");
const pointerenter_1 = require("./event/pointer/pointerenter");
const pointerin_1 = require("./event/pointer/pointerin");
const pointerleave_1 = require("./event/pointer/pointerleave");
const pointermove_1 = require("./event/pointer/pointermove");
const pointerout_1 = require("./event/pointer/pointerout");
const pointerup_1 = require("./event/pointer/pointerup");
const toggle_1 = require("./event/popover/toggle");
const wheel_1 = require("./event/wheel");
exports.UI_EVENT_SET = new Set([
    'click',
    'dbclick',
    'longpress',
    'longclick',
    'pointerdown',
    'pointermove',
    'pointerup',
    'pointerenter',
    'pointerleave',
    'dragstart',
    'dragend',
    'dragover',
    'drop',
    'input',
    'change',
    'paste',
    'keydown',
    'keyup',
    'keypress',
    'wheel',
    'message',
    'toggle',
    'show',
    'hide',
    'load',
    'loadeddata',
]);
function makeUIEventListener(event, callback) {
    switch (event) {
        case 'message':
            return (0, message_1.makeMessageListener)(callback);
        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 'pointerin':
            return (0, pointerin_1.makePointerInListener)(callback);
        case 'pointerout':
            return (0, pointerout_1.makePointerOutListener)(callback);
        case 'dragstart':
            return (0, dragstart_1.makeDragStartListener)(callback);
        case 'dragend':
            return (0, dragend_1.makeDragEndListener)(callback);
        case 'dragover':
            return (0, dragover_1.makeDragOverListener)(callback);
        case 'drop':
            return (0, drop_1.makeDropListener)(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);
        case 'toggle':
            return (0, toggle_1.makeToggleListener)(callback);
        case 'load':
            return (0, load_1.makeLoadListener)(callback);
        case 'loadeddata':
            return (0, loadeddata_1.makeLoadedDataListener)(callback);
        default:
            throw new Error(`unknown UI event: ${event}`);
    }
}
//# sourceMappingURL=makeEventListener.js.map