fixed all tslint errors
This commit is contained in:
@ -5,11 +5,11 @@ export class Body extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
super("w:body");
|
||||
//this.root.push(new SectionProperties()); not actually needed
|
||||
// this.root.push(new SectionProperties()); not actually needed
|
||||
}
|
||||
|
||||
push(component: XmlComponent) {
|
||||
//this.root.splice(this.body.length - 1, 0, component);
|
||||
// this.root.splice(this.body.length - 1, 0, component);
|
||||
this.root.push(component);
|
||||
}
|
||||
}
|
||||
|
@ -54,8 +54,8 @@ export class DocumentAttributes extends XmlAttributeComponent {
|
||||
xsi: "xmlns:xsi",
|
||||
type: "xsi:type"
|
||||
}, properties);
|
||||
|
||||
this.root = properties
|
||||
|
||||
this.root = properties;
|
||||
|
||||
if (!properties) {
|
||||
this.root = {};
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {XmlComponent} from "../xml-components";
|
||||
import {DocumentAttributes} from "./document-attributes"
|
||||
import {DocumentAttributes} from "./document-attributes";
|
||||
import {Body} from "./body";
|
||||
import {Paragraph} from "../paragraph";
|
||||
|
||||
@ -34,7 +34,7 @@ export class Document extends XmlComponent {
|
||||
addParagraph(paragraph: Paragraph): void {
|
||||
this.body.push(paragraph);
|
||||
}
|
||||
|
||||
|
||||
clearVariables(): void {
|
||||
this.body.clearVariables();
|
||||
delete this.body;
|
||||
|
@ -14,7 +14,7 @@ class Border extends XmlComponent {
|
||||
}
|
||||
|
||||
export class ThematicBreak extends XmlComponent {
|
||||
|
||||
|
||||
constructor() {
|
||||
super("w:pBdr");
|
||||
this.root.push(new Border());
|
||||
|
@ -98,9 +98,9 @@ export class Paragraph extends XmlComponent {
|
||||
this.properties.push(new MaxRightTabStop());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
leftTabStop(position: number): Paragraph {
|
||||
this.properties.push(new LeftTabStop(position))
|
||||
this.properties.push(new LeftTabStop(position));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ import {XmlComponent, Attributes} from "../xml-components";
|
||||
import {Style} from "./style";
|
||||
|
||||
export class NumberProperties extends XmlComponent {
|
||||
|
||||
|
||||
constructor() {
|
||||
super("w:numPr");
|
||||
this.root.push(new IndentLevel(0));
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {XmlComponent, Attributes} from "../xml-components";
|
||||
|
||||
export class Bold extends XmlComponent {
|
||||
|
||||
|
||||
constructor() {
|
||||
super("w:b");
|
||||
this.root.push(new Attributes({
|
||||
@ -20,7 +20,7 @@ export class Italics extends XmlComponent {
|
||||
}
|
||||
}
|
||||
|
||||
// needs work. add more types of underline
|
||||
// TODO needs work. add more types of underline
|
||||
export class Underline extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
@ -121,7 +121,7 @@ export class Size extends XmlComponent {
|
||||
}
|
||||
}
|
||||
|
||||
// needs work. Add more types of vertical align
|
||||
// TODO needs work. Add more types of vertical align
|
||||
export class VerticalAlign extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
|
@ -4,7 +4,7 @@ import {Bold, Italics, Underline} from "./formatting";
|
||||
|
||||
export class Run extends XmlComponent {
|
||||
private properties: RunProperties;
|
||||
|
||||
|
||||
|
||||
constructor() {
|
||||
super("w:r");
|
||||
@ -26,12 +26,12 @@ export class Run extends XmlComponent {
|
||||
this.properties.push(new Underline());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
break(): Run {
|
||||
// TODO
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
tab(): Run {
|
||||
// TODO
|
||||
return this;
|
||||
|
@ -9,7 +9,7 @@ export abstract class XmlAttributeComponent extends BaseXmlComponent {
|
||||
super("_attr");
|
||||
this.xmlKeys = xmlKeys;
|
||||
|
||||
this.root = properties
|
||||
this.root = properties;
|
||||
|
||||
if (!properties) {
|
||||
this.root = {};
|
||||
@ -19,7 +19,7 @@ export abstract class XmlAttributeComponent extends BaseXmlComponent {
|
||||
replaceKey(): void {
|
||||
if (this.root !== undefined) {
|
||||
_.forOwn(this.root, (value, key) => {
|
||||
var newKey = this.xmlKeys[key];
|
||||
let newKey = this.xmlKeys[key];
|
||||
this.root[newKey] = value;
|
||||
delete this.root[key];
|
||||
});
|
||||
|
@ -10,8 +10,8 @@ export abstract class XmlComponent extends BaseXmlComponent {
|
||||
}
|
||||
|
||||
replaceKey(): void {
|
||||
//console.log(this.rootKey);
|
||||
//console.log(this.root);
|
||||
// console.log(this.rootKey);
|
||||
// console.log(this.root);
|
||||
if (this.root !== undefined) {
|
||||
this.root.forEach(root => {
|
||||
if (root && root instanceof BaseXmlComponent) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {XmlComponent} from "./"
|
||||
import {XmlComponent} from "./";
|
||||
import {ParagraphProperties} from "../paragraph/properties";
|
||||
import {RunProperties} from "../run/properties";
|
||||
|
||||
@ -42,7 +42,7 @@ export class MultiPropertyXmlComponent extends XmlComponent {
|
||||
super(rootKey);
|
||||
this.runProperties = new RunProperties();
|
||||
this.root.push(this.runProperties);
|
||||
|
||||
|
||||
this.paragraphProperties = new ParagraphProperties();
|
||||
this.root.push(this.paragraphProperties);
|
||||
}
|
||||
|
Reference in New Issue
Block a user