class Emitter {
    private events: { [key: string]: ((...args: any[]) => void)[] } = {};
    on(event: string, listener: (...args: any[]) => void) {
        if (!this.events[event]) {
            this.events[event] = [];
        }
        this.events[event].push(listener);
    }
    emit(event: string, ...args: any[]) {
        if (this.events[event]) {
            this.events[event].forEach(listener => listener(...args));
        }
    }
    off(event: string, listener: (...args: any[]) => void) {
        if (this.events[event]) {
            this.events[event] = this.events[event].filter(l => l !== listener);
        }
    }
}
export default new Emitter();
export enum EmitterEvent {
    choosed_local_directory = 'choosed_local_directory',
    update_directory = 'update_directory',
}
