2016-03-29 22:55:37 +01:00
|
|
|
export interface XmlComponent {
|
2016-04-03 01:44:18 +01:00
|
|
|
xmlKeys: Object;
|
2016-03-28 03:55:33 +01:00
|
|
|
}
|
|
|
|
|
2016-03-29 04:50:23 +01:00
|
|
|
interface AttributesProperties {
|
2016-03-30 02:55:11 +01:00
|
|
|
val?: any;
|
2016-03-29 04:50:23 +01:00
|
|
|
color?: string;
|
|
|
|
space?: string;
|
|
|
|
sz?: string;
|
2016-03-30 00:28:05 +01:00
|
|
|
type?: string;
|
2016-03-31 23:01:20 +01:00
|
|
|
rsidR?: string;
|
|
|
|
rsidRPr?: string;
|
|
|
|
rsidSect?: string;
|
|
|
|
w?: string;
|
|
|
|
h?: string;
|
2016-04-03 05:23:13 +01:00
|
|
|
top?: string;
|
|
|
|
right?: string;
|
|
|
|
bottom?: string;
|
|
|
|
left?: string;
|
|
|
|
header?: string;
|
|
|
|
footer?: string;
|
|
|
|
gutter?: string;
|
|
|
|
linePitch?: string;
|
2016-03-29 04:50:23 +01:00
|
|
|
}
|
|
|
|
|
2016-03-29 22:55:37 +01:00
|
|
|
export class Attributes implements XmlComponent {
|
2016-03-28 03:55:33 +01:00
|
|
|
private _attrs: Object;
|
|
|
|
|
2016-04-03 05:23:13 +01:00
|
|
|
xmlKeys = {
|
|
|
|
val: "w:val",
|
|
|
|
color: "w:color",
|
|
|
|
space: "w:space",
|
|
|
|
sz: "w:sz",
|
|
|
|
type: "w:type",
|
|
|
|
rsidR: "w:rsidR",
|
|
|
|
rsidRPr: "w:rsidRPr",
|
|
|
|
rsidSect: "w:rsidSect",
|
|
|
|
w: "w:w",
|
|
|
|
h: "w:h",
|
|
|
|
top: "w:top",
|
|
|
|
right: "w:right",
|
|
|
|
bottom: "w:bottom",
|
|
|
|
left: "w:left",
|
|
|
|
header: "w:header",
|
|
|
|
footer: "w:footer",
|
|
|
|
gutter: "w:gutter",
|
|
|
|
linePitch: "w:linePitch"
|
|
|
|
};
|
2016-04-03 01:44:18 +01:00
|
|
|
|
2016-03-29 04:50:23 +01:00
|
|
|
constructor(properties?: AttributesProperties) {
|
|
|
|
this._attrs = properties
|
2016-03-29 22:55:37 +01:00
|
|
|
|
2016-03-29 04:50:23 +01:00
|
|
|
if (!properties) {
|
|
|
|
this._attrs = {};
|
|
|
|
}
|
2016-04-03 05:23:13 +01:00
|
|
|
|
|
|
|
this._attrs["xmlKeys"] = this.xmlKeys;
|
2016-03-28 03:55:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-29 22:55:37 +01:00
|
|
|
export class Text implements XmlComponent {
|
2016-03-28 03:55:33 +01:00
|
|
|
private t: string;
|
|
|
|
|
2016-04-03 01:44:18 +01:00
|
|
|
xmlKeys = {
|
|
|
|
t: 'w:t'
|
|
|
|
}
|
|
|
|
|
2016-03-28 03:55:33 +01:00
|
|
|
constructor(text: string) {
|
|
|
|
this.t = text;
|
|
|
|
}
|
|
|
|
}
|