undo(graphics, type) {
    const filterComp = graphics.getComponent(FILTER);

    if (type === 'mask') {
      const mask = this.undoData.object;
      graphics.add(mask);
      graphics.setActiveObject(mask);

      return filterComp.remove(type);
    }

    // options changed case
    if (this.undoData.options) {
      return filterComp.add(type, this.undoData.options);
    }

    // filter added case
    return filterComp.remove(type);
  }
@param {Graphics} graphics - Graphics instance
@param {string} type - Filter type
@returns {Promise}