Declarative numbering work
This commit is contained in:
@ -596,10 +596,15 @@ describe("Paragraph", () => {
|
||||
|
||||
describe("#setNumbering", () => {
|
||||
it("should add list paragraph style to JSON", () => {
|
||||
const numbering = new Numbering();
|
||||
const numberedAbstract = numbering.createAbstractNumbering();
|
||||
numberedAbstract.createLevel(0, "lowerLetter", "%1)", "start");
|
||||
const letterNumbering = numbering.createConcreteNumbering(numberedAbstract);
|
||||
const numbering = new Numbering({
|
||||
levels: [
|
||||
{
|
||||
level: 0,
|
||||
format: "lowerLetter",
|
||||
text: "%1)",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const paragraph = new Paragraph({
|
||||
numbering: {
|
||||
@ -622,9 +627,16 @@ describe("Paragraph", () => {
|
||||
});
|
||||
|
||||
it("it should add numbered properties", () => {
|
||||
const numbering = new Numbering();
|
||||
const numbering = new Numbering({
|
||||
levels: [
|
||||
{
|
||||
level: 0,
|
||||
format: "lowerLetter",
|
||||
text: "%1)",
|
||||
},
|
||||
],
|
||||
});
|
||||
const numberedAbstract = numbering.createAbstractNumbering();
|
||||
numberedAbstract.createLevel(0, "lowerLetter", "%1)", "start");
|
||||
const letterNumbering = numbering.createConcreteNumbering(numberedAbstract);
|
||||
|
||||
const paragraph = new Paragraph({
|
||||
|
@ -1,6 +1,6 @@
|
||||
// http://officeopenxml.com/WPparagraph.php
|
||||
import { FootnoteReferenceRun } from "file/footnotes/footnote/run/reference-run";
|
||||
import { Num } from "file/numbering/num";
|
||||
import { ConcreteNumbering } from "file/numbering/num";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
import { Alignment, AlignmentType } from "./formatting/alignment";
|
||||
@ -41,7 +41,7 @@ export interface IParagraphOptions {
|
||||
readonly level: number;
|
||||
};
|
||||
readonly numbering?: {
|
||||
readonly num: Num;
|
||||
readonly num: ConcreteNumbering;
|
||||
readonly level: number;
|
||||
readonly custom?: boolean;
|
||||
};
|
||||
|
Reference in New Issue
Block a user