Use LevelFormat string enum rather than strings

This commit is contained in:
Dolan
2020-12-24 04:26:45 +00:00
parent 502db14bba
commit 38c8220e9e
8 changed files with 238 additions and 61 deletions

View File

@ -1,7 +1,7 @@
// Numbered lists - Add parent number in sub number
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, Packer, Paragraph } from "../build";
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build";
const doc = new Document({
numbering: {
@ -10,7 +10,7 @@ const doc = new Document({
levels: [
{
level: 0,
format: "decimal",
format: LevelFormat.DECIMAL,
text: "%1",
alignment: AlignmentType.START,
style: {
@ -21,7 +21,7 @@ const doc = new Document({
},
{
level: 1,
format: "decimal",
format: LevelFormat.DECIMAL,
text: "%1.%2",
alignment: AlignmentType.START,
style: {