diff --git a/src/file/document/body/body.ts b/src/file/document/body/body.ts index 691dfd7518..138a629409 100644 --- a/src/file/document/body/body.ts +++ b/src/file/document/body/body.ts @@ -1,6 +1,6 @@ -import { XmlComponent, IXmlableObject } from "file/xml-components"; -import { SectionProperties, SectionPropertiesOptions } from "./section-properties/section-properties"; +import { IXmlableObject, XmlComponent } from "file/xml-components"; import { Paragraph, ParagraphProperties } from "../.."; +import { SectionProperties, SectionPropertiesOptions } from "./section-properties/section-properties"; export class Body extends XmlComponent { private defaultSection: SectionProperties; @@ -22,7 +22,7 @@ export class Body extends XmlComponent { * - last section should be direct child of body * @param section new section */ - addSection(section: SectionPropertiesOptions | SectionProperties) { + public addSection(section: SectionPropertiesOptions | SectionProperties): void { const currentSection = this.sections.pop() as SectionProperties; this.root.push(this.createSectionParagraph(currentSection)); if (section instanceof SectionProperties) { @@ -45,11 +45,11 @@ export class Body extends XmlComponent { this.root.push(component); } - get DefaultSection() { + get DefaultSection(): SectionProperties { return this.defaultSection; } - private createSectionParagraph(section: SectionProperties) { + private createSectionParagraph(section: SectionProperties): Paragraph { const paragraph = new Paragraph(); const properties = new ParagraphProperties(); properties.addChildElement(section); diff --git a/src/file/document/body/section-properties/footer-reference/footer-reference.ts b/src/file/document/body/section-properties/footer-reference/footer-reference.ts index 3805676841..6c2786432d 100644 --- a/src/file/document/body/section-properties/footer-reference/footer-reference.ts +++ b/src/file/document/body/section-properties/footer-reference/footer-reference.ts @@ -1,13 +1,13 @@ import { XmlComponent } from "file/xml-components"; import { FooterReferenceAttributes, FooterReferenceType } from "./footer-reference-attributes"; -export interface FooterOptions { +export interface IFooterOptions { footerType?: FooterReferenceType; footerId?: number; } export class FooterReference extends XmlComponent { - constructor(options: FooterOptions) { + constructor(options: IFooterOptions) { super("w:footerReference"); this.root.push( diff --git a/src/file/document/body/section-properties/header-reference/header-reference.ts b/src/file/document/body/section-properties/header-reference/header-reference.ts index 4065ed5253..8464a33a92 100644 --- a/src/file/document/body/section-properties/header-reference/header-reference.ts +++ b/src/file/document/body/section-properties/header-reference/header-reference.ts @@ -1,13 +1,13 @@ import { XmlComponent } from "file/xml-components"; import { HeaderReferenceAttributes, HeaderReferenceType } from "./header-reference-attributes"; -export interface HeaderOptions { +export interface IHeaderOptions { headerType?: HeaderReferenceType; headerId?: number; } export class HeaderReference extends XmlComponent { - constructor(options: HeaderOptions) { + constructor(options: IHeaderOptions) { super("w:headerReference"); this.root.push( new HeaderReferenceAttributes({ diff --git a/src/file/document/body/section-properties/page-size/page-size.ts b/src/file/document/body/section-properties/page-size/page-size.ts index bf5499d3f1..6aa400bea2 100644 --- a/src/file/document/body/section-properties/page-size/page-size.ts +++ b/src/file/document/body/section-properties/page-size/page-size.ts @@ -1,5 +1,5 @@ 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 { constructor(width: number, height: number, orientation: PageOrientation) { diff --git a/src/file/document/body/section-properties/section-properties.ts b/src/file/document/body/section-properties/section-properties.ts index 557d33acb4..f448a1a2cf 100644 --- a/src/file/document/body/section-properties/section-properties.ts +++ b/src/file/document/body/section-properties/section-properties.ts @@ -5,8 +5,8 @@ import { Columns } from "./columns/columns"; import { IColumnsAttributes } from "./columns/columns-attributes"; import { DocumentGrid } from "./doc-grid/doc-grid"; import { IDocGridAttributesProperties } from "./doc-grid/doc-grid-attributes"; -import { FooterOptions, FooterReference } from "./footer-reference/footer-reference"; -import { HeaderOptions, HeaderReference } from "./header-reference/header-reference"; +import { FooterReference, IFooterOptions } from "./footer-reference/footer-reference"; +import { HeaderReference, IHeaderOptions } from "./header-reference/header-reference"; import { HeaderReferenceType } from "./header-reference/header-reference-attributes"; import { PageMargin } from "./page-margin/page-margin"; import { IPageMarginAttributes } from "./page-margin/page-margin-attributes"; @@ -18,8 +18,8 @@ export type SectionPropertiesOptions = IPageSizeAttributes & IPageMarginAttributes & IColumnsAttributes & IDocGridAttributesProperties & - HeaderOptions & - FooterOptions & + IHeaderOptions & + IFooterOptions & IPageNumberTypeAttributes; export class SectionProperties extends XmlComponent { diff --git a/src/file/document/document.ts b/src/file/document/document.ts index 5e0d3276e7..d8db84adf3 100644 --- a/src/file/document/document.ts +++ b/src/file/document/document.ts @@ -71,7 +71,7 @@ export class Document extends XmlComponent { return run; } - get Body() { + get Body(): Body { return this.body; } } diff --git a/src/file/footer/footer.ts b/src/file/footer/footer.ts index 34ee22a43e..cbdd4a544d 100644 --- a/src/file/footer/footer.ts +++ b/src/file/footer/footer.ts @@ -32,7 +32,7 @@ export class Footer extends XmlComponent { ); } - get referenceId() { + public get referenceId(): number { return this.refId; } diff --git a/src/file/header/header.ts b/src/file/header/header.ts index f1a9f566c4..b0ffaa8a63 100644 --- a/src/file/header/header.ts +++ b/src/file/header/header.ts @@ -32,7 +32,7 @@ export class Header extends XmlComponent { ); } - get referenceId() { + get referenceId(): number { return this.refId; }