UNPKG

docx

Version:

Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.

24 lines (19 loc) 931 B
// http://www.datypic.com/sc/ooxml/e-m_sPre-1.html import { XmlComponent } from "file/xml-components"; import { MathComponent } from "../../math-component"; import { MathBase, MathSubScriptElement, MathSuperScriptElement } from "../../n-ary"; import { MathPreSubSuperScriptProperties } from "./math-pre-sub-super-script-function-properties"; export interface IMathPreSubSuperScriptOptions { readonly children: MathComponent[]; readonly subScript: MathComponent[]; readonly superScript: MathComponent[]; } export class MathPreSubSuperScript extends XmlComponent { constructor(options: IMathPreSubSuperScriptOptions) { super("m:sPre"); this.root.push(new MathPreSubSuperScriptProperties()); this.root.push(new MathBase(options.children)); this.root.push(new MathSubScriptElement(options.subScript)); this.root.push(new MathSuperScriptElement(options.superScript)); } }