* feat: change all enums to as const objects * Add word to dictionary --------- Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { Attributes, XmlComponent } from "@file/xml-components";
|
|
import { hexColorValue } from "@util/values";
|
|
|
|
export const UnderlineType = {
|
|
SINGLE: "single",
|
|
WORDS: "words",
|
|
DOUBLE: "double",
|
|
THICK: "thick",
|
|
DOTTED: "dotted",
|
|
DOTTEDHEAVY: "dottedHeavy",
|
|
DASH: "dash",
|
|
DASHEDHEAVY: "dashedHeavy",
|
|
DASHLONG: "dashLong",
|
|
DASHLONGHEAVY: "dashLongHeavy",
|
|
DOTDASH: "dotDash",
|
|
DASHDOTHEAVY: "dashDotHeavy",
|
|
DOTDOTDASH: "dotDotDash",
|
|
DASHDOTDOTHEAVY: "dashDotDotHeavy",
|
|
WAVE: "wave",
|
|
WAVYHEAVY: "wavyHeavy",
|
|
WAVYDOUBLE: "wavyDouble",
|
|
NONE: "none",
|
|
} as const;
|
|
|
|
export class Underline extends XmlComponent {
|
|
public constructor(underlineType: (typeof UnderlineType)[keyof typeof UnderlineType] = UnderlineType.SINGLE, color?: string) {
|
|
super("w:u");
|
|
this.root.push(
|
|
new Attributes({
|
|
val: underlineType,
|
|
color: color === undefined ? undefined : hexColorValue(color),
|
|
}),
|
|
);
|
|
}
|
|
}
|