Add work for custom level id

This commit is contained in:
Dolan
2019-11-06 20:54:39 +00:00
parent a622c210ef
commit 9b40b5e55e
7 changed files with 77 additions and 95 deletions

View File

@ -1,7 +1,7 @@
import { Attributes, XmlComponent } from "file/xml-components";
export class NumberProperties extends XmlComponent {
constructor(numberId: number, indentLevel: number) {
constructor(numberId: number | string, indentLevel: number) {
super("w:numPr");
this.root.push(new IndentLevel(indentLevel));
this.root.push(new NumberId(numberId));
@ -20,11 +20,11 @@ class IndentLevel extends XmlComponent {
}
class NumberId extends XmlComponent {
constructor(id: number) {
constructor(id: number | string) {
super("w:numId");
this.root.push(
new Attributes({
val: id,
val: typeof id === "string" ? `__${id}__` : id,
}),
);
}