2017-12-30 20:25:16 +00:00
|
|
|
import { Attributes, XmlComponent } from "file/xml-components";
|
2016-03-30 02:55:11 +01:00
|
|
|
|
2016-04-09 20:16:35 +01:00
|
|
|
export class NumberProperties extends XmlComponent {
|
2019-11-06 20:54:39 +00:00
|
|
|
constructor(numberId: number | string, indentLevel: number) {
|
2016-04-09 20:16:35 +01:00
|
|
|
super("w:numPr");
|
2017-03-07 19:14:57 +01:00
|
|
|
this.root.push(new IndentLevel(indentLevel));
|
|
|
|
this.root.push(new NumberId(numberId));
|
2016-03-30 02:55:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-17 16:28:54 +01:00
|
|
|
class IndentLevel extends XmlComponent {
|
2016-03-30 02:55:11 +01:00
|
|
|
constructor(level: number) {
|
2016-04-09 20:16:35 +01:00
|
|
|
super("w:ilvl");
|
2018-01-23 01:33:12 +00:00
|
|
|
this.root.push(
|
|
|
|
new Attributes({
|
|
|
|
val: level,
|
|
|
|
}),
|
|
|
|
);
|
2016-03-30 02:55:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-17 16:28:54 +01:00
|
|
|
class NumberId extends XmlComponent {
|
2019-11-06 20:54:39 +00:00
|
|
|
constructor(id: number | string) {
|
2016-04-09 20:16:35 +01:00
|
|
|
super("w:numId");
|
2018-01-23 01:33:12 +00:00
|
|
|
this.root.push(
|
|
|
|
new Attributes({
|
2019-11-08 03:11:19 +00:00
|
|
|
val: typeof id === "string" ? `{${id}}` : id,
|
2018-01-23 01:33:12 +00:00
|
|
|
}),
|
|
|
|
);
|
2016-03-30 02:55:11 +01:00
|
|
|
}
|
2017-03-08 21:36:09 +00:00
|
|
|
}
|