added numbering

This commit is contained in:
Dolan Miu
2016-05-21 00:02:46 +01:00
parent cf3cd6b6a2
commit 8dcdbeef2f
7 changed files with 168 additions and 6 deletions

35
ts/numbering/num.ts Normal file
View File

@ -0,0 +1,35 @@
import {XmlComponent, Attributes, XmlAttributeComponent} from "../docx/xml-components";
class AbstractNumId extends XmlComponent {
constructor(value: number) {
super("w:abstractNumId");
this.root.push(new Attributes({
val: value
}));
}
}
interface NumAttributesProperties {
numId: number
}
class NumAttributes extends XmlAttributeComponent {
constructor(properties: NumAttributesProperties) {
super({
numId: "w:numId"
}, properties);
}
}
export class Num extends XmlComponent {
constructor(numId: number, abstractNumId: number) {
super("w:num");
this.root.push(new NumAttributes({
numId: numId
}));
this.root.push(new AbstractNumId(abstractNumId));
}
}