2019-08-15 00:47:55 +01:00
|
|
|
import { XmlComponent } from "file/xml-components";
|
|
|
|
|
2020-10-12 22:13:03 +01:00
|
|
|
import { MathComponent } from "../math-component";
|
2019-08-15 00:47:55 +01:00
|
|
|
import { MathDenominator } from "./math-denominator";
|
|
|
|
import { MathNumerator } from "./math-numerator";
|
|
|
|
|
|
|
|
export interface IMathFractionOptions {
|
2020-10-13 02:06:27 +01:00
|
|
|
readonly numerator: MathComponent[];
|
|
|
|
readonly denominator: MathComponent[];
|
2019-08-15 00:47:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export class MathFraction extends XmlComponent {
|
2020-10-10 13:41:26 +01:00
|
|
|
constructor(options: IMathFractionOptions) {
|
2019-08-15 00:47:55 +01:00
|
|
|
super("m:f");
|
|
|
|
|
2020-10-12 22:13:03 +01:00
|
|
|
this.root.push(new MathNumerator(options.numerator));
|
|
|
|
this.root.push(new MathDenominator(options.denominator));
|
2019-08-15 00:47:55 +01:00
|
|
|
}
|
|
|
|
}
|