fixed more linting issues

This commit is contained in:
Dolan
2017-04-15 20:11:54 +01:00
parent 410152441b
commit 17b28cb724
6 changed files with 8 additions and 5 deletions

View File

@ -99,7 +99,7 @@ class TableCell extends XmlComponent {
return this; return this;
} }
public prepForXml(): object { public prepForXml(): XmlableObject {
// Cells must end with a paragraph // Cells must end with a paragraph
const retval = super.prepForXml(); const retval = super.prepForXml();
const content = retval["w:tc"]; const content = retval["w:tc"];

View File

@ -5,5 +5,5 @@ export abstract class BaseXmlComponent {
this.rootKey = rootKey; this.rootKey = rootKey;
} }
public abstract prepForXml(): object; public abstract prepForXml(): XmlableObject;
} }

View File

@ -11,7 +11,7 @@ export abstract class XmlAttributeComponent<T> extends BaseXmlComponent {
this.root = properties; this.root = properties;
} }
public prepForXml(): {_attr: {[key: string]: (string | number | boolean)}} { public prepForXml(): XmlableObject {
const attrs = {}; const attrs = {};
Object.keys(this.root).forEach((key) => { Object.keys(this.root).forEach((key) => {
const value = this.root[key]; const value = this.root[key];

View File

@ -9,7 +9,7 @@ export abstract class XmlComponent extends BaseXmlComponent {
this.root = new Array<BaseXmlComponent>(); this.root = new Array<BaseXmlComponent>();
} }
public prepForXml(): object { public prepForXml(): XmlableObject {
const children = this.root.map((comp) => { const children = this.root.map((comp) => {
if (comp instanceof BaseXmlComponent) { if (comp instanceof BaseXmlComponent) {
return comp.prepForXml(); return comp.prepForXml();

View File

@ -0,0 +1,3 @@
declare interface XmlableObject extends Object {
_attr?: { [key: string]: (string | number | boolean) }
}

View File

@ -1,7 +1,7 @@
import { BaseXmlComponent } from "../docx/xml-components"; import { BaseXmlComponent } from "../docx/xml-components";
export class Formatter { export class Formatter {
public format(input: BaseXmlComponent): any { public format(input: BaseXmlComponent): XmlableObject {
return input.prepForXml(); return input.prepForXml();
} }
} }