fix abstract-number linter warnings
This commit is contained in:
@ -1,20 +1,19 @@
|
|||||||
import {XmlComponent} from "../docx/xml-components";
|
|
||||||
import {XmlAttributeComponent} from "../docx/xml-components";
|
|
||||||
import {Level} from "./level";
|
|
||||||
import {MultiLevelType} from "./multi-level-type";
|
|
||||||
import * as _ from "lodash";
|
import * as _ from "lodash";
|
||||||
|
import { XmlAttributeComponent, XmlComponent } from "../docx/xml-components";
|
||||||
|
import { Level } from "./level";
|
||||||
|
import { MultiLevelType } from "./multi-level-type";
|
||||||
|
|
||||||
interface AbstractNumberingAttributesProperties {
|
interface IAbstractNumberingAttributesProperties {
|
||||||
abstractNumId?: number;
|
abstractNumId?: number;
|
||||||
restartNumberingAfterBreak?: number;
|
restartNumberingAfterBreak?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
class AbstractNumberingAttributes extends XmlAttributeComponent {
|
class AbstractNumberingAttributes extends XmlAttributeComponent {
|
||||||
|
|
||||||
constructor(properties: AbstractNumberingAttributesProperties) {
|
constructor(properties: IAbstractNumberingAttributesProperties) {
|
||||||
super({
|
super({
|
||||||
abstractNumId: "w:abstractNumId",
|
abstractNumId: "w:abstractNumId",
|
||||||
restartNumberingAfterBreak: "w15:restartNumberingAfterBreak"
|
restartNumberingAfterBreak: "w15:restartNumberingAfterBreak",
|
||||||
}, properties);
|
}, properties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -25,18 +24,18 @@ export class AbstractNumbering extends XmlComponent {
|
|||||||
super("w:abstractNum");
|
super("w:abstractNum");
|
||||||
this.root.push(new AbstractNumberingAttributes({
|
this.root.push(new AbstractNumberingAttributes({
|
||||||
abstractNumId: id,
|
abstractNumId: id,
|
||||||
restartNumberingAfterBreak: 0
|
restartNumberingAfterBreak: 0,
|
||||||
}));
|
}));
|
||||||
this.root.push(new MultiLevelType("hybridMultilevel"));
|
this.root.push(new MultiLevelType("hybridMultilevel"));
|
||||||
}
|
}
|
||||||
|
|
||||||
addLevel(level: Level): void {
|
public addLevel(level: Level): void {
|
||||||
this.root.push(level);
|
this.root.push(level);
|
||||||
}
|
}
|
||||||
|
|
||||||
clearVariables() {
|
public clearVariables(): void {
|
||||||
_.forEach(this.root, element => {
|
_.forEach(this.root, (element) => {
|
||||||
element.clearVariables();
|
element.clearVariables();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user