Files
docx-js/ts/numbering/num.ts

35 lines
796 B
TypeScript
Raw Normal View History

2016-05-21 00:02:46 +01:00
import {XmlComponent, Attributes, XmlAttributeComponent} from "../docx/xml-components";
class AbstractNumId extends XmlComponent {
2016-05-26 15:08:34 +01:00
2016-05-21 00:02:46 +01:00
constructor(value: number) {
super("w:abstractNumId");
this.root.push(new Attributes({
val: value
}));
}
}
interface NumAttributesProperties {
2016-05-26 15:08:34 +01:00
numId: number;
2016-05-21 00:02:46 +01:00
}
class NumAttributes extends XmlAttributeComponent {
2016-05-26 15:08:34 +01:00
2016-05-21 00:02:46 +01:00
constructor(properties: NumAttributesProperties) {
super({
numId: "w:numId"
}, properties);
}
}
export class Num extends XmlComponent {
2016-05-26 15:08:34 +01:00
2016-05-21 00:02:46 +01:00
constructor(numId: number, abstractNumId: number) {
super("w:num");
this.root.push(new NumAttributes({
numId: numId
}));
this.root.push(new AbstractNumId(abstractNumId));
}
}