Files
docx-js/src/file/paragraph/run/emphasis-mark.ts
Stepan Svechnikov a756a7697c 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>
2023-12-22 01:25:00 +00:00

29 lines
793 B
TypeScript

import { Attributes, XmlComponent } from "@file/xml-components";
export const EmphasisMarkType = {
DOT: "dot",
} as const;
export abstract class BaseEmphasisMark extends XmlComponent {
protected constructor(emphasisMarkType: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType]) {
super("w:em");
this.root.push(
new Attributes({
val: emphasisMarkType,
}),
);
}
}
export class EmphasisMark extends BaseEmphasisMark {
public constructor(emphasisMarkType: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType] = EmphasisMarkType.DOT) {
super(emphasisMarkType);
}
}
export class DotEmphasisMark extends BaseEmphasisMark {
public constructor() {
super(EmphasisMarkType.DOT);
}
}