import { Decoration_Type } from "./../../ricos-schema/next-schema/index.js";
const strikethroughConverter = {
  fromPm: {
    type: Decoration_Type.STRIKETHROUGH,
    convert: (mark) => {
      const { type: _, attrs } = mark;
      if (typeof attrs?.strikethroughData === "undefined" || attrs.strikethroughData) {
        return [{ type: Decoration_Type.STRIKETHROUGH }];
      }
      return [{ type: Decoration_Type.STRIKETHROUGH, ...attrs }];
    }
  },
  toPm: {
    type: Decoration_Type.STRIKETHROUGH,
    convert: (decoration) => {
      const { type: _, ...data } = decoration;
      if (typeof data.strikethroughData === "undefined") {
        return {
          type: Decoration_Type.STRIKETHROUGH,
          attrs: { strikethroughData: true }
        };
      }
      return {
        type: Decoration_Type.STRIKETHROUGH,
        attrs: { ...data }
      };
    }
  }
};
export {
  strikethroughConverter
};
//# sourceMappingURL=strikethrough-converter.js.map
