Add more run properties and Universal measure

This commit is contained in:
Dolan Miu
2022-12-29 09:57:15 +00:00
parent 5907132062
commit 4513bb529b
15 changed files with 342 additions and 190 deletions

View File

@ -1,6 +1,6 @@
import { AttributeData, AttributePayload, Attributes, NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { hpsMeasureValue } from "@util/values";
import { hpsMeasureValue, PositiveUniversalMeasure } from "@util/values";
// This represents element type CT_OnOff, which indicate a boolean value.
//
@ -26,8 +26,13 @@ export class OnOffElement extends XmlComponent {
// <xsd:complexType name="CT_HpsMeasure">
// <xsd:attribute name="val" type="ST_HpsMeasure" use="required"/>
// </xsd:complexType>
// <xsd:simpleType name="ST_HpsMeasure">
// <xsd:union memberTypes="s:ST_UnsignedDecimalNumber s:ST_PositiveUniversalMeasure" />
// </xsd:simpleType>
export class HpsMeasureElement extends XmlComponent {
public constructor(name: string, val: number | string) {
public constructor(name: string, val: number | PositiveUniversalMeasure) {
super(name);
this.root.push(new Attributes({ val: hpsMeasureValue(val) }));
}