added style components
This commit is contained in:
@ -5,7 +5,7 @@ import {LatentStyles} from "./latent-styles";
|
||||
import {LatentStyleException} from "./latent-styles/exceptions";
|
||||
import {LatentStyleExceptionAttributes} from "./latent-styles/exceptions/attributes";
|
||||
|
||||
export class Style implements XmlComponent {
|
||||
export class Styles implements XmlComponent {
|
||||
private styles: Array<XmlComponent>;
|
||||
|
||||
xmlKeys = {
|
||||
|
28
ts/styles/style/attributes.ts
Normal file
28
ts/styles/style/attributes.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import {XmlComponent} from "../../docx/xml-components";
|
||||
|
||||
interface StyleAttributesProperties {
|
||||
type?: string;
|
||||
styleId?: string;
|
||||
default?: string;
|
||||
customStyle?: string;
|
||||
}
|
||||
|
||||
export class StyleAttributes implements XmlComponent {
|
||||
private _attr: Object;
|
||||
|
||||
xmlKeys = {
|
||||
type: "w:type",
|
||||
styleId: "w:styleId",
|
||||
default: "w:default",
|
||||
customStyle: "w:customStyle"
|
||||
};
|
||||
|
||||
constructor(properties?: StyleAttributesProperties) {
|
||||
this._attr = properties
|
||||
|
||||
if (!properties) {
|
||||
this._attr = {};
|
||||
}
|
||||
this._attr["xmlKeys"] = this.xmlKeys;
|
||||
}
|
||||
}
|
0
ts/styles/style/components.ts
Normal file
0
ts/styles/style/components.ts
Normal file
19
ts/styles/style/index.ts
Normal file
19
ts/styles/style/index.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import {XmlComponent} from "../../docx/xml-components";
|
||||
import {StyleAttributes} from "./attributes";
|
||||
|
||||
export class Style implements XmlComponent {
|
||||
private style: Array<XmlComponent>;
|
||||
|
||||
xmlKeys = {
|
||||
style: "w:style"
|
||||
}
|
||||
|
||||
constructor(attributes: StyleAttributes) {
|
||||
this.style = new Array<XmlComponent>();
|
||||
this.style.push(attributes);
|
||||
}
|
||||
|
||||
push(styleSegment: XmlComponent): void {
|
||||
this.style.push(styleSegment);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user