now extends XmlComponent
This commit is contained in:
@ -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) {
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user