UNPKG

docx

Version:

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

20 lines (15 loc) 593 B
import { XmlComponent } from "file/xml-components"; import { MathComponent } from "../math-component"; import { MathDenominator } from "./math-denominator"; import { MathNumerator } from "./math-numerator"; export interface IMathFractionOptions { readonly numerator: MathComponent[]; readonly denominator: MathComponent[]; } export class MathFraction extends XmlComponent { constructor(options: IMathFractionOptions) { super("m:f"); this.root.push(new MathNumerator(options.numerator)); this.root.push(new MathDenominator(options.denominator)); } }