
import { Emitter } from '../../../../../base/common/event.js';
import { Disposable } from '../../../../../base/common/lifecycle.js';

var NotebookDiffViewEventType;
(function(NotebookDiffViewEventType) {
    NotebookDiffViewEventType[NotebookDiffViewEventType["LayoutChanged"] = 1] = "LayoutChanged";
    NotebookDiffViewEventType[NotebookDiffViewEventType["CellLayoutChanged"] = 2] = "CellLayoutChanged";
})(NotebookDiffViewEventType || (NotebookDiffViewEventType = {}));
class NotebookDiffLayoutChangedEvent {
    constructor(source, value) {
        this.source = source;
        this.value = value;
        this.type = NotebookDiffViewEventType.LayoutChanged;
    }
}
class NotebookDiffEditorEventDispatcher extends Disposable {
    constructor() {
        super(...arguments);
        this._onDidChangeLayout = this._register(( new Emitter()));
        this.onDidChangeLayout = this._onDidChangeLayout.event;
        this._onDidChangeCellLayout = this._register(( new Emitter()));
        this.onDidChangeCellLayout = this._onDidChangeCellLayout.event;
    }
    emit(events) {
        for (let i = 0, len = events.length; i < len; i++) {
            const e = events[i];
            switch (e.type) {
            case NotebookDiffViewEventType.LayoutChanged:
                this._onDidChangeLayout.fire(e);
                break;
            case NotebookDiffViewEventType.CellLayoutChanged:
                this._onDidChangeCellLayout.fire(e);
                break;
            }
        }
    }
}

export { NotebookDiffEditorEventDispatcher, NotebookDiffLayoutChangedEvent, NotebookDiffViewEventType };
