Made project Prettier compliant
This commit is contained in:
@ -3,14 +3,13 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export type AlignmentOptions = "left" | "center" | "right" | "both";
|
||||
|
||||
export class AlignmentAttributes extends XmlAttributeComponent<{val: AlignmentOptions}> {
|
||||
protected xmlKeys = {val: "w:val"};
|
||||
export class AlignmentAttributes extends XmlAttributeComponent<{ val: AlignmentOptions }> {
|
||||
protected xmlKeys = { val: "w:val" };
|
||||
}
|
||||
|
||||
export class Alignment extends XmlComponent {
|
||||
|
||||
constructor(type: AlignmentOptions) {
|
||||
super("w:jc");
|
||||
this.root.push(new AlignmentAttributes({val: type}));
|
||||
this.root.push(new AlignmentAttributes({ val: type }));
|
||||
}
|
||||
}
|
||||
|
@ -2,20 +2,20 @@
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
class Border extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
super("w:bottom");
|
||||
this.root.push(new Attributes({
|
||||
color: "auto",
|
||||
space: "1",
|
||||
val: "single",
|
||||
sz: "6",
|
||||
}));
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
color: "auto",
|
||||
space: "1",
|
||||
val: "single",
|
||||
sz: "6",
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class ThematicBreak extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
super("w:pBdr");
|
||||
this.root.push(new Border());
|
||||
|
@ -20,7 +20,6 @@ class IndentAttributes extends XmlAttributeComponent<IIndentAttributesProperties
|
||||
}
|
||||
|
||||
export class Indent extends XmlComponent {
|
||||
|
||||
constructor(attrs: object) {
|
||||
super("w:ind");
|
||||
this.root.push(new IndentAttributes(attrs));
|
||||
|
@ -3,17 +3,17 @@ import { Attributes, XmlComponent } from "file/xml-components";
|
||||
import { Run } from "../run";
|
||||
|
||||
class Break extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
super("w:br");
|
||||
this.root.push(new Attributes({
|
||||
type: "page",
|
||||
}));
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
type: "page",
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class PageBreak extends Run {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.root.push(new Break());
|
||||
|
@ -6,18 +6,18 @@ import { Spacing } from "./spacing";
|
||||
describe("Spacing", () => {
|
||||
describe("#constructor", () => {
|
||||
it("should set the properties given", () => {
|
||||
const spacing = new Spacing({before: 100, after: 120, line: 150});
|
||||
const spacing = new Spacing({ before: 100, after: 120, line: 150 });
|
||||
const tree = new Formatter().format(spacing);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:spacing": [{_attr: {"w:after": 120, "w:before": 100, "w:line": 150}}],
|
||||
"w:spacing": [{ _attr: { "w:after": 120, "w:before": 100, "w:line": 150 } }],
|
||||
});
|
||||
});
|
||||
|
||||
it("should only set the given properties", () => {
|
||||
const spacing = new Spacing({before: 100});
|
||||
const spacing = new Spacing({ before: 100 });
|
||||
const tree = new Formatter().format(spacing);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:spacing": [{_attr: {"w:before": 100}}],
|
||||
"w:spacing": [{ _attr: { "w:before": 100 } }],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class Style extends XmlComponent {
|
||||
|
||||
constructor(type: string) {
|
||||
super("w:pStyle");
|
||||
this.root.push(new Attributes({
|
||||
val: type,
|
||||
}));
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
val: type,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class TabStop extends XmlComponent {
|
||||
|
||||
constructor(tab: Tab) {
|
||||
super("w:tabs");
|
||||
this.root.push(tab);
|
||||
@ -11,18 +10,19 @@ export class TabStop extends XmlComponent {
|
||||
|
||||
export type TabValue = "left" | "right" | "center" | "bar" | "clear" | "decimal" | "end" | "num" | "start";
|
||||
|
||||
export class TabAttributes extends XmlAttributeComponent<{val: TabValue, pos: string | number}> {
|
||||
protected xmlKeys = {val: "w:val", pos: "w:pos"};
|
||||
export class TabAttributes extends XmlAttributeComponent<{ val: TabValue; pos: string | number }> {
|
||||
protected xmlKeys = { val: "w:val", pos: "w:pos" };
|
||||
}
|
||||
|
||||
export class Tab extends XmlComponent {
|
||||
|
||||
constructor(value: TabValue, position: string | number) {
|
||||
super("w:tab");
|
||||
this.root.push(new TabAttributes({
|
||||
val: value,
|
||||
pos: position,
|
||||
}));
|
||||
this.root.push(
|
||||
new TabAttributes({
|
||||
val: value,
|
||||
pos: position,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class NumberProperties extends XmlComponent {
|
||||
|
||||
constructor(numberId: number, indentLevel: number) {
|
||||
super("w:numPr");
|
||||
this.root.push(new IndentLevel(indentLevel));
|
||||
@ -10,20 +9,23 @@ export class NumberProperties extends XmlComponent {
|
||||
}
|
||||
|
||||
class IndentLevel extends XmlComponent {
|
||||
|
||||
constructor(level: number) {
|
||||
super("w:ilvl");
|
||||
this.root.push(new Attributes({
|
||||
val: level,
|
||||
}));
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
val: level,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NumberId extends XmlComponent {
|
||||
constructor(id: number) {
|
||||
super("w:numId");
|
||||
this.root.push(new Attributes({
|
||||
val: id,
|
||||
}));
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
val: id,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user