fixed all tslint errors

This commit is contained in:
Dolan Miu
2016-05-26 15:08:34 +01:00
parent f075d3b719
commit a2284df881
42 changed files with 253 additions and 254 deletions

View File

@ -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);
}
}

View File

@ -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 = {};

View File

@ -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;

View File

@ -14,7 +14,7 @@ class Border extends XmlComponent {
}
export class ThematicBreak extends XmlComponent {
constructor() {
super("w:pBdr");
this.root.push(new Border());

View File

@ -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;
}

View File

@ -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));

View File

@ -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() {

View File

@ -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;

View File

@ -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];
});

View File

@ -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) {

View File

@ -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);
}