2018-06-21 12:03:34 +02:00
|
|
|
// http://officeopenxml.com/WPSectionPgNumType.php
|
2018-06-22 22:59:38 +01:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
2018-06-21 12:03:34 +02:00
|
|
|
|
|
|
|
export enum PageNumberFormat {
|
|
|
|
CARDINAL_TEXT = "cardinalText",
|
|
|
|
DECIMAL = "decimal",
|
|
|
|
DECIMAL_ENCLOSED_CIRCLE = "decimalEnclosedCircle",
|
|
|
|
DECIMAL_ENCLOSED_FULL_STOP = "decimalEnclosedFullstop",
|
|
|
|
DECIMAL_ENCLOSED_PAREN = "decimalEnclosedParen",
|
|
|
|
DECIMAL_ZERO = "decimalZero",
|
|
|
|
LOWER_LETTER = "lowerLetter",
|
|
|
|
LOWER_ROMAN = "lowerRoman",
|
|
|
|
NONE = "none",
|
|
|
|
ORDINAL_TEXT = "ordinalText",
|
|
|
|
UPPER_LETTER = "upperLetter",
|
|
|
|
UPPER_ROMAN = "upperRoman",
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IPageNumberTypeAttributes {
|
2018-11-02 02:51:57 +00:00
|
|
|
readonly pageNumberStart?: number;
|
|
|
|
readonly pageNumberFormatType?: PageNumberFormat;
|
2018-06-21 12:03:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export class PageNumberTypeAttributes extends XmlAttributeComponent<IPageNumberTypeAttributes> {
|
2018-11-02 02:51:57 +00:00
|
|
|
protected readonly xmlKeys = {
|
2018-06-21 12:03:34 +02:00
|
|
|
pageNumberStart: "w:start",
|
|
|
|
pageNumberFormatType: "w:fmt",
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export class PageNumberType extends XmlComponent {
|
|
|
|
constructor(start?: number, numberFormat?: PageNumberFormat) {
|
|
|
|
super("w:pgNumType");
|
|
|
|
this.root.push(
|
|
|
|
new PageNumberTypeAttributes({
|
|
|
|
pageNumberStart: start,
|
|
|
|
pageNumberFormatType: numberFormat,
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|