import Vue from 'vue/dist/vue'
import EventTypes from "./EventTypes";

export default new Vue({
    methods: {
        emitEvent(event, ...args) {
            if (typeof event === 'undefined' || Object.values(EventTypes).indexOf(event) === -1) {
                console.error('Beware, you are trying to emit an unknown event "' + event + '", check EventTypes.js for available values.')
                //console.log(Object.values(EventTypes));
                return;
            }

            return this.$emit(event, ...args);
        },
    }
})