Files
docx-js/ts/docx/xml-components/index.ts

30 lines
819 B
TypeScript
Raw Normal View History

2016-04-25 03:28:02 +01:00
import * as _ from "lodash";
import {BaseXmlComponent} from "./base";
2016-04-25 03:28:02 +01:00
2016-04-21 23:27:46 +01:00
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);
2016-04-10 05:09:02 +01:00
if (this.root !== undefined) {
this.root.forEach(root => {
2016-05-01 22:24:20 +01:00
if (root && root instanceof BaseXmlComponent) {
root.replaceKey();
}
2016-04-10 05:09:02 +01:00
});
2016-04-21 23:27:46 +01:00
this[this.rootKey] = this.root;
delete this.root;
}
}
}
export * from "./attributes"
export * from "./default-attributes";
export * from "./unit";
export * from "./property";