Change all project enums to objects with as const (#2445)

* feat: change all enums to as const objects

* Add word to dictionary

---------

Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
This commit is contained in:
Stepan Svechnikov
2023-12-22 10:25:00 +09:00
committed by GitHub
parent fd1ea5b4dc
commit a756a7697c
60 changed files with 790 additions and 666 deletions

View File

@ -1,8 +1,8 @@
import { IgnoreIfEmptyXmlComponent } from "@file/xml-components";
import { TableWidthElement, WidthType } from "../table-width";
import { TableWidthElement, WidthType } from "@file/table";
export interface ITableCellMarginOptions {
readonly marginUnitType?: WidthType;
readonly marginUnitType?: (typeof WidthType)[keyof typeof WidthType];
readonly top?: number;
readonly bottom?: number;
readonly left?: number;
@ -33,14 +33,15 @@ export interface ITableCellMarginOptions {
// </xsd:sequence>
// </xsd:complexType>
export enum TableCellMarginElementType {
TABLE = "w:tblCellMar",
TABLE_CELL = "w:tcMar",
}
export const TableCellMarginElementType = {
TABLE: "w:tblCellMar",
// eslint-disable-next-line @typescript-eslint/naming-convention
TABLE_CELL: "w:tcMar",
} as const;
export class TableCellMargin extends IgnoreIfEmptyXmlComponent {
public constructor(
type: TableCellMarginElementType,
type: (typeof TableCellMarginElementType)[keyof typeof TableCellMarginElementType],
{ marginUnitType = WidthType.DXA, top, left, bottom, right }: ITableCellMarginOptions,
) {
super(type);