Enabled declarations in tsconfig to be true
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import { XmlAttributeComponent } from "../xml-components";
|
import { XmlAttributeComponent } from "../xml-components";
|
||||||
|
|
||||||
interface IDocumentAttributesProperties {
|
export interface IDocumentAttributesProperties {
|
||||||
wpc?: string;
|
wpc?: string;
|
||||||
mc?: string;
|
mc?: string;
|
||||||
o?: string;
|
o?: string;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
||||||
|
|
||||||
type alignmentOptions = "left" | "center" | "right" | "both";
|
export type AlignmentOptions = "left" | "center" | "right" | "both";
|
||||||
|
|
||||||
class AlignmentAttributes extends XmlAttributeComponent<{val: alignmentOptions}> {
|
export class AlignmentAttributes extends XmlAttributeComponent<{val: AlignmentOptions}> {
|
||||||
protected xmlKeys = {val: "w:val"};
|
protected xmlKeys = {val: "w:val"};
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Alignment extends XmlComponent {
|
export class Alignment extends XmlComponent {
|
||||||
|
|
||||||
constructor(type: alignmentOptions) {
|
constructor(type: AlignmentOptions) {
|
||||||
super("w:jc");
|
super("w:jc");
|
||||||
this.root.push(new AlignmentAttributes({val: type}));
|
this.root.push(new AlignmentAttributes({val: type}));
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
||||||
|
|
||||||
class TabStop extends XmlComponent {
|
export class TabStop extends XmlComponent {
|
||||||
|
|
||||||
constructor(tab: Tab) {
|
constructor(tab: Tab) {
|
||||||
super("w:tabs");
|
super("w:tabs");
|
||||||
@ -8,15 +8,15 @@ class TabStop extends XmlComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type tabOptions = "left" | "right";
|
export type TabOptions = "left" | "right";
|
||||||
|
|
||||||
class TabAttributes extends XmlAttributeComponent<{val: tabOptions, pos: string | number}> {
|
export class TabAttributes extends XmlAttributeComponent<{val: TabOptions, pos: string | number}> {
|
||||||
protected xmlKeys = {val: "w:val", pos: "w:pos"};
|
protected xmlKeys = {val: "w:val", pos: "w:pos"};
|
||||||
}
|
}
|
||||||
|
|
||||||
class Tab extends XmlComponent {
|
export class Tab extends XmlComponent {
|
||||||
|
|
||||||
constructor(value: tabOptions, position: string | number) {
|
constructor(value: TabOptions, position: string | number) {
|
||||||
super("w:tab");
|
super("w:tab");
|
||||||
this.root.push(new TabAttributes({
|
this.root.push(new TabAttributes({
|
||||||
val: value,
|
val: value,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Attributes, XmlComponent } from "../xml-components";
|
import { Attributes, XmlComponent } from "../xml-components";
|
||||||
|
|
||||||
abstract class VerticalAlign extends XmlComponent {
|
export abstract class VerticalAlign extends XmlComponent {
|
||||||
|
|
||||||
constructor(type: string) {
|
constructor(type: string) {
|
||||||
super("w:vertAlign");
|
super("w:vertAlign");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Attributes, XmlComponent } from "../xml-components";
|
import { Attributes, XmlComponent } from "../xml-components";
|
||||||
|
|
||||||
abstract class BaseUnderline extends XmlComponent {
|
export abstract class BaseUnderline extends XmlComponent {
|
||||||
|
|
||||||
constructor(underlineType: string, color?: string) {
|
constructor(underlineType: string, color?: string) {
|
||||||
super("w:u");
|
super("w:u");
|
||||||
|
@ -2,7 +2,7 @@ import { Paragraph } from "../paragraph";
|
|||||||
import { XmlComponent } from "../xml-components";
|
import { XmlComponent } from "../xml-components";
|
||||||
|
|
||||||
import { TableGrid } from "./grid";
|
import { TableGrid } from "./grid";
|
||||||
import { TableProperties, widthTypes } from "./properties";
|
import { TableProperties, WidthTypes } from "./properties";
|
||||||
|
|
||||||
export class Table extends XmlComponent {
|
export class Table extends XmlComponent {
|
||||||
private properties: TableProperties;
|
private properties: TableProperties;
|
||||||
@ -51,7 +51,7 @@ export class Table extends XmlComponent {
|
|||||||
return this.getRow(row).getCell(col);
|
return this.getRow(row).getCell(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
public setWidth(type: widthTypes, width: number | string): Table {
|
public setWidth(type: WidthTypes, width: number | string): Table {
|
||||||
this.properties.setWidth(type, width);
|
this.properties.setWidth(type, width);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ export class Table extends XmlComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TableRow extends XmlComponent {
|
export class TableRow extends XmlComponent {
|
||||||
private properties: TableRowProperties;
|
private properties: TableRowProperties;
|
||||||
private cells: TableCell[];
|
private cells: TableCell[];
|
||||||
|
|
||||||
@ -79,13 +79,13 @@ class TableRow extends XmlComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TableRowProperties extends XmlComponent {
|
export class TableRowProperties extends XmlComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("w:trPr");
|
super("w:trPr");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TableCell extends XmlComponent {
|
export class TableCell extends XmlComponent {
|
||||||
private properties: TableCellProperties;
|
private properties: TableCellProperties;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -116,7 +116,7 @@ class TableCell extends XmlComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TableCellProperties extends XmlComponent {
|
export class TableCellProperties extends XmlComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("w:tcPr");
|
super("w:tcPr");
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
||||||
|
|
||||||
export type widthTypes = "dxa" | "pct" | "nil" | "auto";
|
export type WidthTypes = "dxa" | "pct" | "nil" | "auto";
|
||||||
|
|
||||||
export class TableProperties extends XmlComponent {
|
export class TableProperties extends XmlComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("w:tblPr");
|
super("w:tblPr");
|
||||||
}
|
}
|
||||||
|
|
||||||
public setWidth(type: widthTypes, w: number | string): TableProperties {
|
public setWidth(type: WidthTypes, w: number | string): TableProperties {
|
||||||
this.root.push(new PreferredTableWidth(type, w));
|
this.root.push(new PreferredTableWidth(type, w));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -19,7 +19,7 @@ export class TableProperties extends XmlComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface ITableWidth {
|
interface ITableWidth {
|
||||||
type: widthTypes;
|
type: WidthTypes;
|
||||||
w: number | string;
|
w: number | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,20 +28,20 @@ class TableWidthAttributes extends XmlAttributeComponent<ITableWidth> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PreferredTableWidth extends XmlComponent {
|
class PreferredTableWidth extends XmlComponent {
|
||||||
constructor(type: widthTypes, w: number | string) {
|
constructor(type: WidthTypes, w: number | string) {
|
||||||
super("w:tblW");
|
super("w:tblW");
|
||||||
this.root.push(new TableWidthAttributes({type, w}));
|
this.root.push(new TableWidthAttributes({type, w}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type tableLayout = "autofit" | "fixed";
|
type TableLayoutOptions = "autofit" | "fixed";
|
||||||
|
|
||||||
class TableLayoutAttributes extends XmlAttributeComponent<{type: tableLayout}> {
|
class TableLayoutAttributes extends XmlAttributeComponent<{type: TableLayoutOptions}> {
|
||||||
protected xmlKeys = {type: "w:type"};
|
protected xmlKeys = {type: "w:type"};
|
||||||
}
|
}
|
||||||
|
|
||||||
class TableLayout extends XmlComponent {
|
class TableLayout extends XmlComponent {
|
||||||
constructor(type: tableLayout) {
|
constructor(type: TableLayoutOptions) {
|
||||||
super("w:tblLayout");
|
super("w:tblLayout");
|
||||||
this.root.push(new TableLayoutAttributes({type}));
|
this.root.push(new TableLayoutAttributes({type}));
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { XmlAttributeComponent } from "./default-attributes";
|
import { XmlAttributeComponent } from "./default-attributes";
|
||||||
|
|
||||||
interface IAttributesProperties {
|
export interface IAttributesProperties {
|
||||||
val?: string | number | boolean;
|
val?: string | number | boolean;
|
||||||
color?: string;
|
color?: string;
|
||||||
space?: string;
|
space?: string;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { BaseXmlComponent } from "./base";
|
import { BaseXmlComponent } from "./base";
|
||||||
|
|
||||||
type AttributeMap<T> = {[P in keyof T]: string};
|
export type AttributeMap<T> = {[P in keyof T]: string};
|
||||||
|
|
||||||
export abstract class XmlAttributeComponent<T> extends BaseXmlComponent {
|
export abstract class XmlAttributeComponent<T> extends BaseXmlComponent {
|
||||||
protected root: T;
|
protected root: T;
|
||||||
|
@ -56,7 +56,7 @@ class LevelJc extends XmlComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class LevelBase extends XmlComponent {
|
export class LevelBase extends XmlComponent {
|
||||||
private paragraphProperties: ParagraphProperties;
|
private paragraphProperties: ParagraphProperties;
|
||||||
private runProperties: RunProperties;
|
private runProperties: RunProperties;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class LevelOverrideAttributes extends XmlAttributeComponent<{ilvl: number}> {
|
|||||||
protected xmlKeys = {ilvl: "w:ilvl"};
|
protected xmlKeys = {ilvl: "w:ilvl"};
|
||||||
}
|
}
|
||||||
|
|
||||||
class LevelOverride extends XmlComponent {
|
export class LevelOverride extends XmlComponent {
|
||||||
private levelNum: number;
|
private levelNum: number;
|
||||||
private lvl?: LevelForOverride;
|
private lvl?: LevelForOverride;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ export class Revision extends XmlComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class DateComponent extends XmlComponent {
|
export abstract class DateComponent extends XmlComponent {
|
||||||
protected getCurrentDate(): string {
|
protected getCurrentDate(): string {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const year = date.getFullYear();
|
const year = date.getFullYear();
|
||||||
|
@ -2,7 +2,7 @@ import { DocumentAttributes } from "../docx/document/document-attributes";
|
|||||||
import { XmlComponent } from "../docx/xml-components";
|
import { XmlComponent } from "../docx/xml-components";
|
||||||
import { Created, Creator, Description, Keywords, LastModifiedBy, Modified, Revision, Subject, Title } from "./components";
|
import { Created, Creator, Description, Keywords, LastModifiedBy, Modified, Revision, Subject, Title } from "./components";
|
||||||
|
|
||||||
interface IPropertiesOptions {
|
export interface IPropertiesOptions {
|
||||||
title?: string;
|
title?: string;
|
||||||
subject?: string;
|
subject?: string;
|
||||||
creator?: string;
|
creator?: string;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { XmlAttributeComponent } from "../docx/xml-components";
|
import { XmlAttributeComponent } from "../docx/xml-components";
|
||||||
|
|
||||||
interface IRelationshipsAttributesProperties {
|
export interface IRelationshipsAttributesProperties {
|
||||||
xmlns: string;
|
xmlns: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { XmlAttributeComponent, XmlComponent } from "../../docx/xml-components";
|
import { XmlAttributeComponent, XmlComponent } from "../../docx/xml-components";
|
||||||
|
|
||||||
interface ILatentStyleExceptionAttributesProperties {
|
export interface ILatentStyleExceptionAttributesProperties {
|
||||||
name?: string;
|
name?: string;
|
||||||
uiPriority?: string;
|
uiPriority?: string;
|
||||||
qFormat?: string;
|
qFormat?: string;
|
||||||
@ -8,7 +8,7 @@ interface ILatentStyleExceptionAttributesProperties {
|
|||||||
unhideWhenUsed?: string;
|
unhideWhenUsed?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LatentStyleExceptionAttributes extends XmlAttributeComponent<ILatentStyleExceptionAttributesProperties> {
|
export class LatentStyleExceptionAttributes extends XmlAttributeComponent<ILatentStyleExceptionAttributesProperties> {
|
||||||
protected xmlKeys = {
|
protected xmlKeys = {
|
||||||
name: "w:name",
|
name: "w:name",
|
||||||
uiPriority: "w:uiPriority",
|
uiPriority: "w:uiPriority",
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
"outDir": "../build",
|
"outDir": "../build",
|
||||||
"sourceRoot": "./",
|
"sourceRoot": "./",
|
||||||
"rootDir": "./",
|
"rootDir": "./",
|
||||||
"module": "commonjs"
|
"module": "commonjs",
|
||||||
|
"declaration": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"tests"
|
"tests"
|
||||||
|
Reference in New Issue
Block a user