Files
docx-js/ts/docx/xml-components/index.ts
2016-05-20 10:08:35 +01:00

30 lines
819 B
TypeScript

import * as _ from "lodash";
import {BaseXmlComponent} from "./base";
export abstract class XmlComponent extends BaseXmlComponent {
protected root: Array<BaseXmlComponent>;
constructor(rootKey: string) {
super(rootKey);
this.root = new Array<BaseXmlComponent>();
}
replaceKey(): void {
//console.log(this.rootKey);
//console.log(this.root);
if (this.root !== undefined) {
this.root.forEach(root => {
if (root && root instanceof BaseXmlComponent) {
root.replaceKey();
}
});
this[this.rootKey] = this.root;
delete this.root;
}
}
}
export * from "./attributes"
export * from "./default-attributes";
export * from "./unit";
export * from "./property";