Files
docx-js/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.ts
Dolan Miu 982d923553 Improve import alias
@file/ and @export/ instead of file/ and export/ etc
2022-06-26 23:26:42 +01:00

24 lines
919 B
TypeScript

// http://www.datypic.com/sc/ooxml/e-m_sSubSup-1.html
import { XmlComponent } from "@file/xml-components";
import { MathComponent } from "../../math-component";
import { MathBase, MathSubScriptElement, MathSuperScriptElement } from "../../n-ary";
import { MathSubSuperScriptProperties } from "./math-sub-super-script-function-properties";
export interface IMathSubSuperScriptOptions {
readonly children: MathComponent[];
readonly subScript: MathComponent[];
readonly superScript: MathComponent[];
}
export class MathSubSuperScript extends XmlComponent {
constructor(options: IMathSubSuperScriptOptions) {
super("m:sSubSup");
this.root.push(new MathSubSuperScriptProperties());
this.root.push(new MathBase(options.children));
this.root.push(new MathSubScriptElement(options.subScript));
this.root.push(new MathSuperScriptElement(options.superScript));
}
}