Fix linting
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import { XmlComponent, IXmlableObject } from "file/xml-components";
|
import { IXmlableObject, XmlComponent } from "file/xml-components";
|
||||||
import { SectionProperties, SectionPropertiesOptions } from "./section-properties/section-properties";
|
|
||||||
import { Paragraph, ParagraphProperties } from "../..";
|
import { Paragraph, ParagraphProperties } from "../..";
|
||||||
|
import { SectionProperties, SectionPropertiesOptions } from "./section-properties/section-properties";
|
||||||
|
|
||||||
export class Body extends XmlComponent {
|
export class Body extends XmlComponent {
|
||||||
private defaultSection: SectionProperties;
|
private defaultSection: SectionProperties;
|
||||||
@ -22,7 +22,7 @@ export class Body extends XmlComponent {
|
|||||||
* - last section should be direct child of body
|
* - last section should be direct child of body
|
||||||
* @param section new section
|
* @param section new section
|
||||||
*/
|
*/
|
||||||
addSection(section: SectionPropertiesOptions | SectionProperties) {
|
public addSection(section: SectionPropertiesOptions | SectionProperties): void {
|
||||||
const currentSection = this.sections.pop() as SectionProperties;
|
const currentSection = this.sections.pop() as SectionProperties;
|
||||||
this.root.push(this.createSectionParagraph(currentSection));
|
this.root.push(this.createSectionParagraph(currentSection));
|
||||||
if (section instanceof SectionProperties) {
|
if (section instanceof SectionProperties) {
|
||||||
@ -45,11 +45,11 @@ export class Body extends XmlComponent {
|
|||||||
this.root.push(component);
|
this.root.push(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
get DefaultSection() {
|
get DefaultSection(): SectionProperties {
|
||||||
return this.defaultSection;
|
return this.defaultSection;
|
||||||
}
|
}
|
||||||
|
|
||||||
private createSectionParagraph(section: SectionProperties) {
|
private createSectionParagraph(section: SectionProperties): Paragraph {
|
||||||
const paragraph = new Paragraph();
|
const paragraph = new Paragraph();
|
||||||
const properties = new ParagraphProperties();
|
const properties = new ParagraphProperties();
|
||||||
properties.addChildElement(section);
|
properties.addChildElement(section);
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { XmlComponent } from "file/xml-components";
|
import { XmlComponent } from "file/xml-components";
|
||||||
import { FooterReferenceAttributes, FooterReferenceType } from "./footer-reference-attributes";
|
import { FooterReferenceAttributes, FooterReferenceType } from "./footer-reference-attributes";
|
||||||
|
|
||||||
export interface FooterOptions {
|
export interface IFooterOptions {
|
||||||
footerType?: FooterReferenceType;
|
footerType?: FooterReferenceType;
|
||||||
footerId?: number;
|
footerId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FooterReference extends XmlComponent {
|
export class FooterReference extends XmlComponent {
|
||||||
constructor(options: FooterOptions) {
|
constructor(options: IFooterOptions) {
|
||||||
super("w:footerReference");
|
super("w:footerReference");
|
||||||
|
|
||||||
this.root.push(
|
this.root.push(
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { XmlComponent } from "file/xml-components";
|
import { XmlComponent } from "file/xml-components";
|
||||||
import { HeaderReferenceAttributes, HeaderReferenceType } from "./header-reference-attributes";
|
import { HeaderReferenceAttributes, HeaderReferenceType } from "./header-reference-attributes";
|
||||||
|
|
||||||
export interface HeaderOptions {
|
export interface IHeaderOptions {
|
||||||
headerType?: HeaderReferenceType;
|
headerType?: HeaderReferenceType;
|
||||||
headerId?: number;
|
headerId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class HeaderReference extends XmlComponent {
|
export class HeaderReference extends XmlComponent {
|
||||||
constructor(options: HeaderOptions) {
|
constructor(options: IHeaderOptions) {
|
||||||
super("w:headerReference");
|
super("w:headerReference");
|
||||||
this.root.push(
|
this.root.push(
|
||||||
new HeaderReferenceAttributes({
|
new HeaderReferenceAttributes({
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { XmlComponent } from "file/xml-components";
|
import { XmlComponent } from "file/xml-components";
|
||||||
import { PageSizeAttributes, PageOrientation } from "./page-size-attributes";
|
import { PageOrientation, PageSizeAttributes } from "./page-size-attributes";
|
||||||
|
|
||||||
export class PageSize extends XmlComponent {
|
export class PageSize extends XmlComponent {
|
||||||
constructor(width: number, height: number, orientation: PageOrientation) {
|
constructor(width: number, height: number, orientation: PageOrientation) {
|
||||||
|
@ -5,8 +5,8 @@ import { Columns } from "./columns/columns";
|
|||||||
import { IColumnsAttributes } from "./columns/columns-attributes";
|
import { IColumnsAttributes } from "./columns/columns-attributes";
|
||||||
import { DocumentGrid } from "./doc-grid/doc-grid";
|
import { DocumentGrid } from "./doc-grid/doc-grid";
|
||||||
import { IDocGridAttributesProperties } from "./doc-grid/doc-grid-attributes";
|
import { IDocGridAttributesProperties } from "./doc-grid/doc-grid-attributes";
|
||||||
import { FooterOptions, FooterReference } from "./footer-reference/footer-reference";
|
import { FooterReference, IFooterOptions } from "./footer-reference/footer-reference";
|
||||||
import { HeaderOptions, HeaderReference } from "./header-reference/header-reference";
|
import { HeaderReference, IHeaderOptions } from "./header-reference/header-reference";
|
||||||
import { HeaderReferenceType } from "./header-reference/header-reference-attributes";
|
import { HeaderReferenceType } from "./header-reference/header-reference-attributes";
|
||||||
import { PageMargin } from "./page-margin/page-margin";
|
import { PageMargin } from "./page-margin/page-margin";
|
||||||
import { IPageMarginAttributes } from "./page-margin/page-margin-attributes";
|
import { IPageMarginAttributes } from "./page-margin/page-margin-attributes";
|
||||||
@ -18,8 +18,8 @@ export type SectionPropertiesOptions = IPageSizeAttributes &
|
|||||||
IPageMarginAttributes &
|
IPageMarginAttributes &
|
||||||
IColumnsAttributes &
|
IColumnsAttributes &
|
||||||
IDocGridAttributesProperties &
|
IDocGridAttributesProperties &
|
||||||
HeaderOptions &
|
IHeaderOptions &
|
||||||
FooterOptions &
|
IFooterOptions &
|
||||||
IPageNumberTypeAttributes;
|
IPageNumberTypeAttributes;
|
||||||
|
|
||||||
export class SectionProperties extends XmlComponent {
|
export class SectionProperties extends XmlComponent {
|
||||||
|
@ -71,7 +71,7 @@ export class Document extends XmlComponent {
|
|||||||
return run;
|
return run;
|
||||||
}
|
}
|
||||||
|
|
||||||
get Body() {
|
get Body(): Body {
|
||||||
return this.body;
|
return this.body;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ export class Footer extends XmlComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get referenceId() {
|
public get referenceId(): number {
|
||||||
return this.refId;
|
return this.refId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ export class Header extends XmlComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get referenceId() {
|
get referenceId(): number {
|
||||||
return this.refId;
|
return this.refId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user