Add MathIntegral class
This commit is contained in:
31
src/file/paragraph/math/n-ary/math-integral.ts
Normal file
31
src/file/paragraph/math/n-ary/math-integral.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import { XmlComponent } from "@file/xml-components";
|
||||
|
||||
import { MathComponent } from "../math-component";
|
||||
import { MathBase } from "./math-base";
|
||||
import { MathNAryProperties } from "./math-n-ary-properties";
|
||||
import { MathSubScriptElement } from "./math-sub-script";
|
||||
import { MathSuperScriptElement } from "./math-super-script";
|
||||
|
||||
export interface IMathIntegralOptions {
|
||||
readonly children: readonly MathComponent[];
|
||||
readonly subScript?: readonly MathComponent[];
|
||||
readonly superScript?: readonly MathComponent[];
|
||||
}
|
||||
|
||||
export class MathIntegral extends XmlComponent {
|
||||
public constructor(options: IMathIntegralOptions) {
|
||||
super("m:nary");
|
||||
|
||||
this.root.push(new MathNAryProperties("", !!options.superScript, !!options.subScript));
|
||||
|
||||
if (!!options.subScript) {
|
||||
this.root.push(new MathSubScriptElement(options.subScript));
|
||||
}
|
||||
|
||||
if (!!options.superScript) {
|
||||
this.root.push(new MathSuperScriptElement(options.superScript));
|
||||
}
|
||||
|
||||
this.root.push(new MathBase(options.children));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user