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:
committed by
GitHub
parent
fd1ea5b4dc
commit
a756a7697c
@ -1,11 +1,11 @@
|
||||
import { Attributes, XmlComponent } from "@file/xml-components";
|
||||
|
||||
export enum EmphasisMarkType {
|
||||
DOT = "dot",
|
||||
}
|
||||
export const EmphasisMarkType = {
|
||||
DOT: "dot",
|
||||
} as const;
|
||||
|
||||
export abstract class BaseEmphasisMark extends XmlComponent {
|
||||
protected constructor(emphasisMarkType: EmphasisMarkType) {
|
||||
protected constructor(emphasisMarkType: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType]) {
|
||||
super("w:em");
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
@ -16,7 +16,7 @@ export abstract class BaseEmphasisMark extends XmlComponent {
|
||||
}
|
||||
|
||||
export class EmphasisMark extends BaseEmphasisMark {
|
||||
public constructor(emphasisMarkType: EmphasisMarkType = EmphasisMarkType.DOT) {
|
||||
public constructor(emphasisMarkType: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType] = EmphasisMarkType.DOT) {
|
||||
super(emphasisMarkType);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user