lots of tslinting

This commit is contained in:
Dolan
2017-03-08 21:36:09 +00:00
parent 72683ea990
commit 0e89606ec9
13 changed files with 52 additions and 52 deletions

View File

@ -5,7 +5,7 @@ export class Columns extends XmlComponent {
constructor() { constructor() {
super("w:cols"); super("w:cols");
this.root.push(new Attributes({ this.root.push(new Attributes({
space: "708" space: "708",
})); }));
} }
} }

View File

@ -5,7 +5,7 @@ export class DocumentGrid extends XmlComponent {
constructor() { constructor() {
super("w:docGrid"); super("w:docGrid");
this.root.push(new Attributes({ this.root.push(new Attributes({
linePitch: "360" linePitch: "360",
})); }));
} }
} }

View File

@ -1,5 +1,5 @@
import { Attributes, XmlComponent } from "../../xml-components"; import { Attributes, XmlComponent } from "../../xml-components";
import {SectionProperties} from "./section-properties"; import { SectionProperties } from "./section-properties";
export class Body extends XmlComponent { export class Body extends XmlComponent {
@ -8,7 +8,7 @@ export class Body extends XmlComponent {
// this.root.push(new SectionProperties()); not actually needed // this.root.push(new SectionProperties()); not actually needed
} }
push(component: XmlComponent) { public push(component: XmlComponent): void {
// this.root.splice(this.body.length - 1, 0, component); // this.root.splice(this.body.length - 1, 0, component);
this.root.push(component); this.root.push(component);
} }

View File

@ -6,7 +6,7 @@ export class PageSize extends XmlComponent {
super("w:pgSz"); super("w:pgSz");
this.root.push(new Attributes({ this.root.push(new Attributes({
w: "11906", w: "11906",
h: "16838" h: "16838",
})); }));
} }
} }

View File

@ -52,7 +52,7 @@ export class DocumentAttributes extends XmlAttributeComponent {
dcterms: "xmlns:dcterms", dcterms: "xmlns:dcterms",
dcmitype: "xmlns:dcmitype", dcmitype: "xmlns:dcmitype",
xsi: "xmlns:xsi", xsi: "xmlns:xsi",
type: "xsi:type" type: "xsi:type",
}, properties); }, properties);
this.root = properties; this.root = properties;

View File

@ -1,4 +1,4 @@
export {Document} from "./document"; export { Document } from "./document";
export {Paragraph} from "./paragraph"; export { Paragraph } from "./paragraph";
export {Run} from "./run" export { Run } from "./run";
export {TextRun} from "./run/text-run" export { TextRun } from "./run/text-run";

View File

@ -8,7 +8,7 @@ class Border extends XmlComponent {
color: "auto", color: "auto",
space: "1", space: "1",
val: "single", val: "single",
sz: "6" sz: "6",
})); }));
} }
} }
@ -19,4 +19,4 @@ export class ThematicBreak extends XmlComponent {
super("w:pBdr"); super("w:pBdr");
this.root.push(new Border()); this.root.push(new Border());
} }
} }

View File

@ -1,19 +1,19 @@
import { Attributes, XmlComponent } from "../xml-components";
import {ThematicBreak} from "./border";
import {PageBreak} from "./page-break";
import {TextRun} from "../run/text-run";
import {ParagraphProperties} from "./properties";
import {MaxRightTabStop, LeftTabStop} from "./tab-stop";
import {Style} from "./style";
import {NumberProperties} from "./unordered-list";
import { Num } from "../../numbering/num"; import { Num } from "../../numbering/num";
import { TextRun } from "../run/text-run";
import { Attributes, XmlComponent } from "../xml-components";
import { ThematicBreak } from "./border";
import { PageBreak } from "./page-break";
import { ParagraphProperties } from "./properties";
import { Style } from "./style";
import { LeftTabStop, MaxRightTabStop } from "./tab-stop";
import { NumberProperties } from "./unordered-list";
class Alignment extends XmlComponent { class Alignment extends XmlComponent {
constructor(type: string) { constructor(type: string) {
super("w:jc"); super("w:jc");
this.root.push(new Attributes({ this.root.push(new Attributes({
val: type val: type,
})); }));
} }
} }
@ -30,82 +30,82 @@ export class Paragraph extends XmlComponent {
} }
} }
addText(run: TextRun): Paragraph { public addText(run: TextRun): Paragraph {
this.root.push(run); this.root.push(run);
return this; return this;
} }
heading1(): Paragraph { public heading1(): Paragraph {
this.properties.push(new Style("Heading1")); this.properties.push(new Style("Heading1"));
return this; return this;
} }
heading2(): Paragraph { public heading2(): Paragraph {
this.properties.push(new Style("Heading2")); this.properties.push(new Style("Heading2"));
return this; return this;
} }
heading3(): Paragraph { public heading3(): Paragraph {
this.properties.push(new Style("Heading3")); this.properties.push(new Style("Heading3"));
return this; return this;
} }
heading4(): Paragraph { public heading4(): Paragraph {
this.properties.push(new Style("Heading4")); this.properties.push(new Style("Heading4"));
return this; return this;
} }
heading5(): Paragraph { public heading5(): Paragraph {
this.properties.push(new Style("Heading5")); this.properties.push(new Style("Heading5"));
return this; return this;
} }
title(): Paragraph { public title(): Paragraph {
this.properties.push(new Style("Title")); this.properties.push(new Style("Title"));
return this; return this;
} }
center(): Paragraph { public center(): Paragraph {
this.properties.push(new Alignment("center")); this.properties.push(new Alignment("center"));
return this; return this;
} }
left(): Paragraph { public left(): Paragraph {
this.properties.push(new Alignment("left")); this.properties.push(new Alignment("left"));
return this; return this;
} }
right(): Paragraph { public right(): Paragraph {
this.properties.push(new Alignment("right")); this.properties.push(new Alignment("right"));
return this; return this;
} }
justified(): Paragraph { public justified(): Paragraph {
this.properties.push(new Alignment("both")); this.properties.push(new Alignment("both"));
return this; return this;
} }
thematicBreak(): Paragraph { public thematicBreak(): Paragraph {
this.properties.push(new ThematicBreak()); this.properties.push(new ThematicBreak());
return this; return this;
} }
pageBreak(): Paragraph { public pageBreak(): Paragraph {
this.properties.push(new PageBreak()); this.properties.push(new PageBreak());
return this; return this;
} }
maxRightTabStop(): Paragraph { public maxRightTabStop(): Paragraph {
this.properties.push(new MaxRightTabStop()); this.properties.push(new MaxRightTabStop());
return this; return this;
} }
leftTabStop(position: number): Paragraph { public leftTabStop(position: number): Paragraph {
this.properties.push(new LeftTabStop(position)); this.properties.push(new LeftTabStop(position));
return this; return this;
} }
bullet(): Paragraph { public bullet(): Paragraph {
this.properties.push(new Style("ListParagraph")); this.properties.push(new Style("ListParagraph"));
this.properties.push(new NumberProperties(1, 0)); this.properties.push(new NumberProperties(1, 0));
return this; return this;

View File

@ -1,12 +1,12 @@
import { Run } from "../run";
import { Attributes, XmlComponent } from "../xml-components"; import { Attributes, XmlComponent } from "../xml-components";
import {Run} from "../run";
class Break extends XmlComponent { class Break extends XmlComponent {
constructor() { constructor() {
super("w:br"); super("w:br");
this.root.push(new Attributes({ this.root.push(new Attributes({
type: "page" type: "page",
})); }));
} }
} }
@ -17,4 +17,4 @@ export class PageBreak extends Run {
super(); super();
this.root.push(new Break()); this.root.push(new Break());
} }
} }

View File

@ -7,7 +7,7 @@ export class ParagraphProperties extends XmlComponent {
this.root.push(new Attributes()); this.root.push(new Attributes());
} }
push(item: XmlComponent): void { public push(item: XmlComponent): void {
this.root.push(item); this.root.push(item);
} }
} }

View File

@ -5,7 +5,7 @@ export class Style extends XmlComponent {
constructor(type: string) { constructor(type: string) {
super("w:pStyle"); super("w:pStyle");
this.root.push(new Attributes({ this.root.push(new Attributes({
val: type val: type,
})); }));
} }
} }

View File

@ -10,11 +10,11 @@ class TabStop extends XmlComponent {
class Tab extends XmlComponent { class Tab extends XmlComponent {
constructor(value: string, position: any) { constructor(value: string, position: number) {
super("w:tab"); super("w:tab");
this.root.push(new Attributes({ this.root.push(new Attributes({
val: value, val: value,
pos: position pos: position.toString(),
})); }));
} }
} }

View File

@ -1,5 +1,5 @@
import { Attributes, XmlComponent } from "../xml-components"; import { Attributes, XmlComponent } from "../xml-components";
import {Style} from "./style"; import { Style } from "./style";
export class NumberProperties extends XmlComponent { export class NumberProperties extends XmlComponent {
@ -15,7 +15,7 @@ class IndentLevel extends XmlComponent {
constructor(level: number) { constructor(level: number) {
super("w:ilvl"); super("w:ilvl");
this.root.push(new Attributes({ this.root.push(new Attributes({
val: level val: level,
})); }));
} }
} }
@ -24,7 +24,7 @@ class NumberId extends XmlComponent {
constructor(id: number) { constructor(id: number) {
super("w:numId"); super("w:numId");
this.root.push(new Attributes({ this.root.push(new Attributes({
val: id val: id,
})); }));
} }
} }