2022-06-26 23:26:42 +01:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
|
2018-09-03 10:54:53 -03:00
|
|
|
|
2023-12-22 10:25:00 +09:00
|
|
|
const FieldCharacterType = {
|
|
|
|
BEGIN: "begin",
|
|
|
|
END: "end",
|
|
|
|
SEPARATE: "separate",
|
|
|
|
} as const;
|
2018-11-02 02:51:57 +00:00
|
|
|
|
2023-12-22 10:25:00 +09:00
|
|
|
class FidCharAttrs extends XmlAttributeComponent<{
|
|
|
|
readonly type: (typeof FieldCharacterType)[keyof typeof FieldCharacterType];
|
|
|
|
readonly dirty?: boolean;
|
|
|
|
}> {
|
2018-11-02 02:51:57 +00:00
|
|
|
protected readonly xmlKeys = { type: "w:fldCharType", dirty: "w:dirty" };
|
2018-09-03 10:54:53 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Begin extends XmlComponent {
|
2022-08-31 07:52:27 +01:00
|
|
|
public constructor(dirty?: boolean) {
|
2018-09-03 10:54:53 -03:00
|
|
|
super("w:fldChar");
|
2018-11-02 02:51:57 +00:00
|
|
|
this.root.push(new FidCharAttrs({ type: FieldCharacterType.BEGIN, dirty }));
|
2018-09-03 10:54:53 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Separate extends XmlComponent {
|
2022-08-31 07:52:27 +01:00
|
|
|
public constructor(dirty?: boolean) {
|
2018-09-03 10:54:53 -03:00
|
|
|
super("w:fldChar");
|
2018-11-02 02:51:57 +00:00
|
|
|
this.root.push(new FidCharAttrs({ type: FieldCharacterType.SEPARATE, dirty }));
|
2018-09-03 10:54:53 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class End extends XmlComponent {
|
2022-08-31 07:52:27 +01:00
|
|
|
public constructor(dirty?: boolean) {
|
2018-09-03 10:54:53 -03:00
|
|
|
super("w:fldChar");
|
2018-11-02 02:51:57 +00:00
|
|
|
this.root.push(new FidCharAttrs({ type: FieldCharacterType.END, dirty }));
|
2018-09-03 10:54:53 -03:00
|
|
|
}
|
|
|
|
}
|