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,17 @@
// Example on how to customise the look at feel using Styles
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, Packer, Paragraph, TextRun, UnderlineType } from "../build";
import {
AlignmentType,
convertInchesToTwip,
Document,
HeadingLevel,
LevelFormat,
Packer,
Paragraph,
TextRun,
UnderlineType,
} from "../build";
const doc = new Document({
creator: "Clippy",
@ -81,7 +91,7 @@ const doc = new Document({
levels: [
{
level: 0,
format: "lowerLetter",
format: LevelFormat.LOWER_LETTER,
text: "%1)",
alignment: AlignmentType.LEFT,
},