Make Paragraph declaritive
This commit is contained in:
@ -9,15 +9,9 @@ describe("ParagraphOutlineLevel", () => {
|
||||
|
||||
describe("#constructor()", () => {
|
||||
it("should create an outlineLevel with given value", () => {
|
||||
outlineLevel = new OutlineLevel("0");
|
||||
outlineLevel = new OutlineLevel(0);
|
||||
const newJson = Utility.jsonify(outlineLevel);
|
||||
assert.equal(newJson.root[0].root.val, "0");
|
||||
});
|
||||
|
||||
it("should create an outlineLevel with blank val", () => {
|
||||
outlineLevel = new OutlineLevel("");
|
||||
const newJson = Utility.jsonify(outlineLevel);
|
||||
assert.equal(newJson.root[0].root.val, "");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -2,11 +2,9 @@
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class OutlineLevel extends XmlComponent {
|
||||
public readonly level: string;
|
||||
|
||||
constructor(level: string) {
|
||||
constructor(public readonly level: number) {
|
||||
super("w:outlineLvl");
|
||||
this.level = level;
|
||||
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
val: level,
|
||||
|
Reference in New Issue
Block a user