"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncEE = exports.AsyncEERef = exports.AsyncEEWatch = exports.AsyncEECall = void 0;
const _refEmitter_1 = require("../../../component/$refEmitter");
const AsyncEECall = (emitter) => {
    return {
        $emit({ type, data }, callback) {
            emitter.emit(type, data);
            callback();
        },
        $eventNames(data, callback) {
            const eventNames = emitter.eventNames();
            callback(eventNames);
        },
    };
};
exports.AsyncEECall = AsyncEECall;
const AsyncEEWatch = (emitter) => {
    return {
        $addListener({ event }, callback) {
            return emitter.addListener(event, callback);
        },
    };
};
exports.AsyncEEWatch = AsyncEEWatch;
const AsyncEERef = (emitter) => {
    return {
        $refEmitter({}) {
            return (0, _refEmitter_1.$refEmitter)(emitter);
        },
    };
};
exports.AsyncEERef = AsyncEERef;
const AsyncEE = (emitter) => {
    return Object.assign(Object.assign(Object.assign({}, (0, exports.AsyncEECall)(emitter)), (0, exports.AsyncEEWatch)(emitter)), (0, exports.AsyncEERef)(emitter));
};
exports.AsyncEE = AsyncEE;
//# sourceMappingURL=AsyncEE.js.map