fixed more linting issues
This commit is contained in:
@ -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"];
|
||||||
|
@ -5,5 +5,5 @@ export abstract class BaseXmlComponent {
|
|||||||
this.rootKey = rootKey;
|
this.rootKey = rootKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract prepForXml(): object;
|
public abstract prepForXml(): XmlableObject;
|
||||||
}
|
}
|
||||||
|
@ -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];
|
||||||
|
@ -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();
|
||||||
|
3
ts/docx/xml-components/xmlable-object.d.ts
vendored
Normal file
3
ts/docx/xml-components/xmlable-object.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
declare interface XmlableObject extends Object {
|
||||||
|
_attr?: { [key: string]: (string | number | boolean) }
|
||||||
|
}
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user