Use new eslint-plugin-functional instead of tslint-immutable
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 {
|
||||
public constructor(widths: number[] | string[]) {
|
||||
public constructor(widths: readonly number[] | readonly string[]) {
|
||||
super("w:tblGrid");
|
||||
for (const width of widths) {
|
||||
this.root.push(new GridCol(width));
|
||||
|
@ -6,7 +6,7 @@ import { Table } from "../table";
|
||||
import { ITableCellPropertiesOptions, TableCellProperties } from "./table-cell-properties";
|
||||
|
||||
export interface ITableCellOptions extends ITableCellPropertiesOptions {
|
||||
readonly children: (Paragraph | Table)[];
|
||||
readonly children: readonly (Paragraph | Table)[];
|
||||
}
|
||||
|
||||
export class TableCell extends XmlComponent {
|
||||
|
@ -3,7 +3,7 @@ import { TableCell } from "../table-cell";
|
||||
import { ITableRowPropertiesOptions, TableRowProperties } from "./table-row-properties";
|
||||
|
||||
export interface ITableRowOptions extends ITableRowPropertiesOptions {
|
||||
readonly children: TableCell[];
|
||||
readonly children: readonly TableCell[];
|
||||
}
|
||||
|
||||
export class TableRow extends XmlComponent {
|
||||
@ -20,7 +20,7 @@ export class TableRow extends XmlComponent {
|
||||
return this.options.children.length;
|
||||
}
|
||||
|
||||
public get cells(): TableCell[] {
|
||||
public get cells(): readonly TableCell[] {
|
||||
return this.root.filter((xmlComponent) => xmlComponent instanceof TableCell);
|
||||
}
|
||||
|
||||
|
@ -21,9 +21,9 @@ import { ITableWidthProperties } from "./table-width";
|
||||
algorithm will expand columns to fit its content
|
||||
*/
|
||||
export interface ITableOptions {
|
||||
readonly rows: TableRow[];
|
||||
readonly rows: readonly TableRow[];
|
||||
readonly width?: ITableWidthProperties;
|
||||
readonly columnWidths?: number[];
|
||||
readonly columnWidths?: readonly number[];
|
||||
readonly margins?: ITableCellMarginOptions;
|
||||
readonly indent?: ITableWidthProperties;
|
||||
readonly float?: ITableFloatOptions;
|
||||
@ -38,6 +38,7 @@ export class Table extends XmlComponent {
|
||||
public constructor({
|
||||
rows,
|
||||
width,
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
columnWidths = Array<number>(Math.max(...rows.map((row) => row.CellCount))).fill(100),
|
||||
margins,
|
||||
indent,
|
||||
|
Reference in New Issue
Block a user