import { Decorations } from "../decorations/index.js";
import { RicosNodeStyle } from "./node-style.js";
import { RicosTextStyle } from "./text-style.js";
class RicosTextNodeStyle {
  constructor(style) {
    this.getTextNodeStyle = () => this.style;
    this.overrideWith = (style) => {
      const decorations = Decorations.of(this.style.decorations).overrideWith(style.decorations).toDecorationArray();
      const nodeStyle = RicosNodeStyle.of(this.style.nodeStyle).overrideWith(style.nodeStyle || {}).getNodeStyle();
      const lineHeight = RicosTextStyle.of({ lineHeight: this.style.lineHeight }).overrideWith({
        lineHeight: style.lineHeight
      }).getTextStyle().lineHeight;
      const textNodeStyle = JSON.parse(JSON.stringify({ decorations, nodeStyle, lineHeight }));
      return new RicosTextNodeStyle(textNodeStyle);
    };
    this.style = style;
  }
}
export {
  RicosTextNodeStyle
};
//# sourceMappingURL=text-node-style.js.map
