fix numbering/level linter warnings
This commit is contained in:
@ -1,19 +1,18 @@
|
|||||||
import {XmlComponent, Attributes, MultiPropertyXmlComponent} from "../docx/xml-components";
|
import { ParagraphProperties } from "../docx/paragraph/properties";
|
||||||
import {XmlAttributeComponent} from "../docx/xml-components";
|
import { RunProperties } from "../docx/run/properties";
|
||||||
import {RunProperties} from "../docx/run/properties";
|
import { Attributes, MultiPropertyXmlComponent, XmlAttributeComponent, XmlComponent } from "../docx/xml-components";
|
||||||
import {ParagraphProperties} from "../docx/paragraph/properties";
|
|
||||||
|
|
||||||
interface LevelAttributesProperties {
|
interface ILevelAttributesProperties {
|
||||||
ilvl?: number;
|
ilvl?: number;
|
||||||
tentative?: number;
|
tentative?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LevelAttributes extends XmlAttributeComponent {
|
class LevelAttributes extends XmlAttributeComponent {
|
||||||
|
|
||||||
constructor(properties: LevelAttributesProperties) {
|
constructor(properties: ILevelAttributesProperties) {
|
||||||
super({
|
super({
|
||||||
ilvl: "w:ilvl",
|
ilvl: "w:ilvl",
|
||||||
tentative: "w15:tentative"
|
tentative: "w15:tentative",
|
||||||
}, properties);
|
}, properties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,7 +22,7 @@ class Start extends XmlComponent {
|
|||||||
constructor(value: number) {
|
constructor(value: number) {
|
||||||
super("w:start");
|
super("w:start");
|
||||||
this.root.push(new Attributes({
|
this.root.push(new Attributes({
|
||||||
val: value
|
val: value,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -33,7 +32,7 @@ class NumberFormat extends XmlComponent {
|
|||||||
constructor(value: string) {
|
constructor(value: string) {
|
||||||
super("w:numFmt");
|
super("w:numFmt");
|
||||||
this.root.push(new Attributes({
|
this.root.push(new Attributes({
|
||||||
val: value
|
val: value,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,7 +42,7 @@ class LevelText extends XmlComponent {
|
|||||||
constructor(value: string) {
|
constructor(value: string) {
|
||||||
super("w:lvlText");
|
super("w:lvlText");
|
||||||
this.root.push(new Attributes({
|
this.root.push(new Attributes({
|
||||||
val: value
|
val: value,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -53,7 +52,7 @@ class LevelJc extends XmlComponent {
|
|||||||
constructor(value: string) {
|
constructor(value: string) {
|
||||||
super("w:lvlJc");
|
super("w:lvlJc");
|
||||||
this.root.push(new Attributes({
|
this.root.push(new Attributes({
|
||||||
val: value
|
val: value,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,7 +65,7 @@ export class Level extends XmlComponent {
|
|||||||
super("w:lvl");
|
super("w:lvl");
|
||||||
this.root.push(new LevelAttributes({
|
this.root.push(new LevelAttributes({
|
||||||
ilvl: level,
|
ilvl: level,
|
||||||
tentative: 1
|
tentative: 1,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.root.push(new Start(1));
|
this.root.push(new Start(1));
|
||||||
@ -81,7 +80,7 @@ export class Level extends XmlComponent {
|
|||||||
this.root.push(this.runProperties);
|
this.root.push(this.runProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
clearVariables(): void {
|
public clearVariables(): void {
|
||||||
this.paragraphProperties.clearVariables();
|
this.paragraphProperties.clearVariables();
|
||||||
this.runProperties.clearVariables();
|
this.runProperties.clearVariables();
|
||||||
|
|
||||||
@ -89,11 +88,11 @@ export class Level extends XmlComponent {
|
|||||||
delete this.runProperties;
|
delete this.runProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
addParagraphProperty(property: XmlComponent): void {
|
public addParagraphProperty(property: XmlComponent): void {
|
||||||
this.paragraphProperties.push(property);
|
this.paragraphProperties.push(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
addRunProperty(property: XmlComponent): void {
|
public addRunProperty(property: XmlComponent): void {
|
||||||
this.runProperties.push(property);
|
this.runProperties.push(property);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user