Initial ESlint conversion
This commit is contained in:
@ -13,7 +13,7 @@ import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
|
||||
import { twipsMeasureValue } from "@util/values";
|
||||
|
||||
export class TableGrid extends XmlComponent {
|
||||
constructor(widths: number[] | string[]) {
|
||||
public constructor(widths: number[] | string[]) {
|
||||
super("w:tblGrid");
|
||||
for (const width of widths) {
|
||||
this.root.push(new GridCol(width));
|
||||
@ -26,7 +26,7 @@ class GridColAttributes extends XmlAttributeComponent<{ readonly w: number | str
|
||||
}
|
||||
|
||||
export class GridCol extends XmlComponent {
|
||||
constructor(width?: number | string) {
|
||||
public constructor(width?: number | string) {
|
||||
super("w:gridCol");
|
||||
if (width !== undefined) {
|
||||
this.root.push(new GridColAttributes({ w: twipsMeasureValue(width) }));
|
||||
|
@ -27,7 +27,7 @@ export interface ITableCellBorders {
|
||||
}
|
||||
|
||||
export class TableCellBorders extends IgnoreIfEmptyXmlComponent {
|
||||
constructor(options: ITableCellBorders) {
|
||||
public constructor(options: ITableCellBorders) {
|
||||
super("w:tcBorders");
|
||||
|
||||
if (options.top) {
|
||||
@ -66,7 +66,7 @@ class GridSpanAttributes extends XmlAttributeComponent<{ readonly val: number }>
|
||||
* GridSpan element. Should be used in a table cell. Pass the number of columns that this cell need to span.
|
||||
*/
|
||||
export class GridSpan extends XmlComponent {
|
||||
constructor(value: number) {
|
||||
public constructor(value: number) {
|
||||
super("w:gridSpan");
|
||||
|
||||
this.root.push(
|
||||
@ -99,7 +99,7 @@ class VerticalMergeAttributes extends XmlAttributeComponent<{ readonly val: Vert
|
||||
* Vertical merge element. Should be used in a table cell.
|
||||
*/
|
||||
export class VerticalMerge extends XmlComponent {
|
||||
constructor(value: VerticalMergeType) {
|
||||
public constructor(value: VerticalMergeType) {
|
||||
super("w:vMerge");
|
||||
|
||||
this.root.push(
|
||||
@ -124,7 +124,7 @@ class TDirectionAttributes extends XmlAttributeComponent<{ readonly val: TextDir
|
||||
* Text Direction within a table cell
|
||||
*/
|
||||
export class TDirection extends XmlComponent {
|
||||
constructor(value: TextDirection) {
|
||||
public constructor(value: TextDirection) {
|
||||
super("w:textDirection");
|
||||
|
||||
this.root.push(
|
||||
|
@ -27,7 +27,7 @@ export interface ITableCellPropertiesOptions {
|
||||
}
|
||||
|
||||
export class TableCellProperties extends IgnoreIfEmptyXmlComponent {
|
||||
constructor(options: ITableCellPropertiesOptions) {
|
||||
public constructor(options: ITableCellPropertiesOptions) {
|
||||
super("w:tcPr");
|
||||
|
||||
if (options.width) {
|
||||
|
@ -10,7 +10,7 @@ export interface ITableCellOptions extends ITableCellPropertiesOptions {
|
||||
}
|
||||
|
||||
export class TableCell extends XmlComponent {
|
||||
constructor(readonly options: ITableCellOptions) {
|
||||
public constructor(readonly options: ITableCellOptions) {
|
||||
super("w:tc");
|
||||
|
||||
this.root.push(new TableCellProperties(options));
|
||||
|
@ -33,7 +33,7 @@ export class TableBorders extends XmlComponent {
|
||||
insideVertical: NONE_BORDER,
|
||||
};
|
||||
|
||||
constructor(options: ITableBordersOptions) {
|
||||
public constructor(options: ITableBordersOptions) {
|
||||
super("w:tblBorders");
|
||||
|
||||
if (options.top) {
|
||||
|
@ -39,7 +39,7 @@ export enum TableCellMarginElementType {
|
||||
}
|
||||
|
||||
export class TableCellMargin extends IgnoreIfEmptyXmlComponent {
|
||||
constructor(type: TableCellMarginElementType, { marginUnitType = WidthType.DXA, top, left, bottom, right }: ITableCellMarginOptions) {
|
||||
public constructor(type: TableCellMarginElementType, { marginUnitType = WidthType.DXA, top, left, bottom, right }: ITableCellMarginOptions) {
|
||||
super(type);
|
||||
|
||||
if (top !== undefined) {
|
||||
|
@ -146,7 +146,7 @@ export class TableFloatOptionsAttributes extends XmlAttributeComponent<ITableFlo
|
||||
}
|
||||
|
||||
export class TableFloatProperties extends XmlComponent {
|
||||
constructor({
|
||||
public constructor({
|
||||
leftFromText,
|
||||
rightFromText,
|
||||
topFromText,
|
||||
|
@ -19,7 +19,7 @@ class TableLayoutAttributes extends XmlAttributeComponent<{ readonly type: Table
|
||||
// <xsd:attribute name="type" type="ST_TblLayoutType"/>
|
||||
// </xsd:complexType>
|
||||
export class TableLayout extends XmlComponent {
|
||||
constructor(type: TableLayoutType) {
|
||||
public constructor(type: TableLayoutType) {
|
||||
super("w:tblLayout");
|
||||
this.root.push(new TableLayoutAttributes({ type }));
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class TableOverlapAttributes extends XmlAttributeComponent<{ readonly val: Overl
|
||||
}
|
||||
|
||||
export class TableOverlap extends XmlComponent {
|
||||
constructor(type: OverlapType) {
|
||||
public constructor(type: OverlapType) {
|
||||
super("w:tblOverlap");
|
||||
this.root.push(new TableOverlapAttributes({ val: type }));
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ export interface ITablePropertiesOptions {
|
||||
}
|
||||
|
||||
export class TableProperties extends IgnoreIfEmptyXmlComponent {
|
||||
constructor(options: ITablePropertiesOptions) {
|
||||
public constructor(options: ITablePropertiesOptions) {
|
||||
super("w:tblPr");
|
||||
|
||||
if (options.style) {
|
||||
|
@ -30,7 +30,7 @@ export class TableRowHeightAttributes extends XmlAttributeComponent<{
|
||||
}
|
||||
|
||||
export class TableRowHeight extends XmlComponent {
|
||||
constructor(value: number | string, rule: HeightRule) {
|
||||
public constructor(value: number | string, rule: HeightRule) {
|
||||
super("w:trHeight");
|
||||
|
||||
this.root.push(
|
||||
|
@ -41,7 +41,7 @@ export interface ITableRowPropertiesOptions {
|
||||
}
|
||||
|
||||
export class TableRowProperties extends IgnoreIfEmptyXmlComponent {
|
||||
constructor(options: ITableRowPropertiesOptions) {
|
||||
public constructor(options: ITableRowPropertiesOptions) {
|
||||
super("w:trPr");
|
||||
|
||||
if (options.cantSplit !== undefined) {
|
||||
|
@ -7,7 +7,7 @@ export interface ITableRowOptions extends ITableRowPropertiesOptions {
|
||||
}
|
||||
|
||||
export class TableRow extends XmlComponent {
|
||||
constructor(private readonly options: ITableRowOptions) {
|
||||
public constructor(private readonly options: ITableRowOptions) {
|
||||
super("w:tr");
|
||||
this.root.push(new TableRowProperties(options));
|
||||
|
||||
|
@ -35,7 +35,7 @@ class TableWidthAttributes extends XmlAttributeComponent<ITableWidthProperties>
|
||||
}
|
||||
|
||||
export class TableWidthElement extends XmlComponent {
|
||||
constructor(name: string, { type = WidthType.AUTO, size }: ITableWidthProperties) {
|
||||
public constructor(name: string, { type = WidthType.AUTO, size }: ITableWidthProperties) {
|
||||
super(name);
|
||||
// super("w:tblW");
|
||||
let tableWidthValue = size;
|
||||
|
@ -35,7 +35,7 @@ export interface ITableOptions {
|
||||
}
|
||||
|
||||
export class Table extends XmlComponent {
|
||||
constructor({
|
||||
public constructor({
|
||||
rows,
|
||||
width,
|
||||
columnWidths = Array<number>(Math.max(...rows.map((row) => row.CellCount))).fill(100),
|
||||
|
Reference in New Issue
Block a user