import { Action } from "../../../src/core/process/undo/Action.js";

class SelectionClearAction extends Action {
    constructor() {
        super();
        this.oldState = null;
    }

    async apply(editor) {
        this.oldState = editor.selection.clone();
        editor.selection.reset();
    }

    async revert(editor) {
        editor.selection.copy(this.oldState);
    }
}

export default SelectionClearAction;
