2016-04-03 05:23:13 +01:00
|
|
|
import {XmlComponent} from "../docx/xml-components";
|
2016-05-26 15:08:34 +01:00
|
|
|
import {DocumentAttributes} from "../docx/document/document-attributes";
|
2016-04-09 02:04:53 +01:00
|
|
|
import {DocumentDefaults} from "./defaults";
|
|
|
|
import {LatentStyles} from "./latent-styles";
|
|
|
|
import {LatentStyleException} from "./latent-styles/exceptions";
|
|
|
|
import {LatentStyleExceptionAttributes} from "./latent-styles/exceptions/attributes";
|
2016-04-03 05:23:13 +01:00
|
|
|
|
2016-04-09 20:16:35 +01:00
|
|
|
export class Styles extends XmlComponent {
|
2016-04-03 05:23:13 +01:00
|
|
|
|
|
|
|
constructor() {
|
2016-04-09 20:16:35 +01:00
|
|
|
super("w:styles");
|
|
|
|
this.root.push(new DocumentAttributes({
|
2016-05-19 23:05:28 +01:00
|
|
|
mc: "http://schemas.openxmlformats.org/markup-compatibility/2006",
|
|
|
|
r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
|
|
|
|
w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
|
|
|
|
w14: "http://schemas.microsoft.com/office/word/2010/wordml",
|
|
|
|
w15: "http://schemas.microsoft.com/office/word/2012/wordml",
|
|
|
|
Ignorable: "w14 w15"
|
2016-05-26 15:08:34 +01:00
|
|
|
}));
|
|
|
|
// let latentStyles = new LatentStyles();
|
|
|
|
// latentStyles.push(new LatentStyleException(new LatentStyleExceptionAttributes({
|
2016-04-09 02:04:53 +01:00
|
|
|
// name: "Normal"
|
2016-05-26 15:08:34 +01:00
|
|
|
// })));
|
|
|
|
// this.root.push(latentStyles);
|
2016-04-09 02:04:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
push(style: XmlComponent): void {
|
2016-04-09 20:16:35 +01:00
|
|
|
this.root.push(style);
|
2016-04-03 05:23:13 +01:00
|
|
|
}
|
2016-05-26 15:08:34 +01:00
|
|
|
|
2016-05-10 00:32:00 +01:00
|
|
|
clearVariables() {
|
|
|
|
this.root.forEach(element => {
|
|
|
|
element.clearVariables();
|
2016-05-26 15:08:34 +01:00
|
|
|
});
|
2016-05-10 00:32:00 +01:00
|
|
|
}
|
2016-04-03 01:44:18 +01:00
|
|
|
}
|