diff --git a/ts/docx/paragraph/tab-stop.ts b/ts/docx/paragraph/tab-stop.ts index f531f6ba84..6154c33d2a 100644 --- a/ts/docx/paragraph/tab-stop.ts +++ b/ts/docx/paragraph/tab-stop.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../xml-components"; class TabStop extends XmlComponent { @@ -8,11 +8,17 @@ class TabStop extends XmlComponent { } } +export type tabOptions = "left" | "right"; + +class TabAttributes extends XmlAttributeComponent<{val: tabOptions, pos: string | number}> { + protected xmlKeys = {val: "w:val", pos: "w:pos"}; +} + class Tab extends XmlComponent { - constructor(value: string, position: string | number) { + constructor(value: tabOptions, position: string | number) { super("w:tab"); - this.root.push(new Attributes({ + this.root.push(new TabAttributes({ val: value, pos: position, }));