diff --git a/demo/1-basic.ts b/demo/1-basic.ts index da44119bbf..925883dd6f 100644 --- a/demo/1-basic.ts +++ b/demo/1-basic.ts @@ -1,7 +1,7 @@ // Simple example to add text to a document // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun } from "../build"; +import { Document, Packer, Paragraph, Tab, TextRun } from "../build"; const doc = new Document({ sections: [ @@ -16,7 +16,7 @@ const doc = new Document({ bold: true, }), new TextRun({ - text: "\tGithub is the best", + children: [new Tab(), "Github is the best"], bold: true, }), ], diff --git a/src/file/paragraph/run/run.ts b/src/file/paragraph/run/run.ts index 7d2a0f2ced..4fb047e0c7 100644 --- a/src/file/paragraph/run/run.ts +++ b/src/file/paragraph/run/run.ts @@ -9,9 +9,10 @@ import { Begin, End, Separate } from "./field"; import { NumberOfPages, NumberOfPagesSection, Page } from "./page-number"; import { IRunPropertiesOptions, RunProperties } from "./properties"; import { Text } from "./run-components/text"; +import { Tab } from "./tab"; export interface IRunOptions extends IRunPropertiesOptions { - readonly children?: readonly (Begin | FieldInstruction | Separate | End | PageNumber | FootnoteReferenceRun | string)[]; + readonly children?: readonly (Begin | FieldInstruction | Separate | End | PageNumber | FootnoteReferenceRun | Tab | string)[]; readonly break?: number; readonly text?: string; }