2018-11-02 02:51:57 +00:00
|
|
|
import { SpaceType } from "file/space-type";
|
2017-12-30 20:25:16 +00:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
2016-05-09 13:02:59 +01:00
|
|
|
|
2018-11-02 02:51:57 +00:00
|
|
|
class TextAttributes extends XmlAttributeComponent<{ readonly space: SpaceType }> {
|
|
|
|
protected readonly xmlKeys = { space: "xml:space" };
|
2017-04-14 11:01:47 +02:00
|
|
|
}
|
2016-05-09 13:02:59 +01:00
|
|
|
|
2017-04-14 11:01:47 +02:00
|
|
|
export class Text extends XmlComponent {
|
2016-05-09 13:02:59 +01:00
|
|
|
constructor(text: string) {
|
|
|
|
super("w:t");
|
2018-11-02 02:51:57 +00:00
|
|
|
this.root.push(new TextAttributes({ space: SpaceType.PRESERVE }));
|
2017-03-09 19:50:33 +01:00
|
|
|
if (text) {
|
|
|
|
this.root.push(text);
|
|
|
|
}
|
2016-05-09 13:02:59 +01:00
|
|
|
}
|
2017-03-08 21:49:41 +00:00
|
|
|
}
|