now extends XmlComponent

This commit is contained in:
Dolan Miu
2016-04-09 20:16:35 +01:00
parent 84610bd72f
commit f68a2aff56
33 changed files with 180 additions and 371 deletions

View File

@ -7,7 +7,7 @@ interface StyleAttributesProperties {
customStyle?: string;
}
export class StyleAttributes implements XmlComponent {
export class StyleAttributes extends XmlComponent {
private _attr: Object;
xmlKeys = {
@ -18,6 +18,7 @@ export class StyleAttributes implements XmlComponent {
};
constructor(properties?: StyleAttributesProperties) {
super("_attr");
this._attr = properties
if (!properties) {

View File

@ -1,14 +1,9 @@
import {XmlComponent} from "../../docx/xml-components";
export class Name implements XmlComponent {
private name: Array<XmlComponent>;
xmlKeys = {
}
export class Name extends XmlComponent {
constructor() {
this.name = new Array<XmlComponent>();
super("w:name");
}
}

View File

@ -1,19 +1,14 @@
import {XmlComponent} from "../../docx/xml-components";
import {StyleAttributes} from "./attributes";
export class Style implements XmlComponent {
private style: Array<XmlComponent>;
xmlKeys = {
style: "w:style"
}
export class Style extends XmlComponent {
constructor(attributes: StyleAttributes) {
this.style = new Array<XmlComponent>();
this.style.push(attributes);
super("w:style");
this.root.push(attributes);
}
push(styleSegment: XmlComponent): void {
this.style.push(styleSegment);
this.root.push(styleSegment);
}
}