Finish making numbering declarative

This commit is contained in:
Dolan
2019-11-08 03:11:19 +00:00
parent 9b40b5e55e
commit 643e3c2f84
14 changed files with 530 additions and 501 deletions

View File

@ -15,14 +15,10 @@ class AbstractNumberingAttributes extends XmlAttributeComponent<IAbstractNumberi
};
}
export interface IAbstractNumberingOptions {
readonly levels: ILevelsOptions[];
}
export class AbstractNumbering extends XmlComponent {
public readonly id: number;
constructor(id: number, options: IAbstractNumberingOptions) {
constructor(id: number, levelOptions: ILevelsOptions[]) {
super("w:abstractNum");
this.root.push(
new AbstractNumberingAttributes({
@ -33,7 +29,7 @@ export class AbstractNumbering extends XmlComponent {
this.root.push(new MultiLevelType("hybridMultilevel"));
this.id = id;
for (const option of options.levels) {
for (const option of levelOptions) {
this.root.push(new Level(option));
}
}