Files
docx-js/src/file/paragraph/run/emphasis-mark.ts

29 lines
793 B
TypeScript
Raw Normal View History

import { Attributes, XmlComponent } from "@file/xml-components";
2020-05-22 12:22:45 +08:00
export const EmphasisMarkType = {
DOT: "dot",
} as const;
2020-05-22 12:22:45 +08:00
export abstract class BaseEmphasisMark extends XmlComponent {
protected constructor(emphasisMarkType: (typeof EmphasisMarkType)[keyof typeof EmphasisMarkType]) {
2020-05-22 12:22:45 +08:00
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) {
2020-05-22 12:22:45 +08:00
super(emphasisMarkType);
}
}
export class DotEmphasisMark extends BaseEmphasisMark {
2022-08-31 07:52:27 +01:00
public constructor() {
2020-05-22 12:22:45 +08:00
super(EmphasisMarkType.DOT);
}
}