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

@ -17,14 +17,17 @@ import { decimalNumber } from "@util/values";
// <xsd:attribute name="charSpace" type="ST_DecimalNumber"/>
// </xsd:complexType>
export enum DocumentGridType {
DEFAULT = "default",
LINES = "lines",
LINES_AND_CHARS = "linesAndChars",
SNAP_TO_CHARS = "snapToChars",
}
/* eslint-disable @typescript-eslint/naming-convention */
export const DocumentGridType = {
DEFAULT: "default",
LINES: "lines",
LINES_AND_CHARS: "linesAndChars",
SNAP_TO_CHARS: "snapToChars",
} as const;
/* eslint-enable */
export interface IDocGridAttributesProperties {
readonly type?: DocumentGridType;
readonly type?: (typeof DocumentGridType)[keyof typeof DocumentGridType];
readonly linePitch?: number;
readonly charSpace?: number;
}
@ -38,7 +41,7 @@ export class DocGridAttributes extends XmlAttributeComponent<IDocGridAttributesP
}
export class DocumentGrid extends XmlComponent {
public constructor(linePitch: number, charSpace?: number, type?: DocumentGridType) {
public constructor(linePitch: number, charSpace?: number, type?: (typeof DocumentGridType)[keyof typeof DocumentGridType]) {
super("w:docGrid");
this.root.push(