Files
docx-js/src/file/paragraph/math/n-ary/math-sum.ts

26 lines
848 B
TypeScript
Raw Normal View History

2019-08-20 20:40:40 +01:00
// http://www.datypic.com/sc/ooxml/e-m_nary-1.html
import { XmlComponent } from "file/xml-components";
import { MathRun } from "../math-run";
import { MathBase } from "./math-base";
import { MathNArayProperties } from "./math-naray-properties";
import { MathSubScript } from "./math-sub-script";
import { MathSuperScript } from "./math-super-script";
export interface IMathSumOptions {
readonly child: MathRun;
readonly subScript?: MathRun;
readonly superScript?: MathRun;
}
export class MathSum extends XmlComponent {
constructor(readonly options: IMathSumOptions) {
super("m:nary");
this.root.push(new MathNArayProperties("∑"));
this.root.push(new MathSubScript(options.child));
this.root.push(new MathSuperScript(options.child));
this.root.push(new MathBase(options.child));
}
}