UNPKG

docx

Version:

Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.

23 lines (22 loc) 1.46 kB
import { FileChild } from '../file-child'; import { FootnoteReferenceRun } from '../footnotes'; import { IContext, IXmlableObject } from '../xml-components'; import { CheckBox } from '../checkbox'; import { DeletedTextRun, InsertedTextRun } from '../track-revision'; import { ColumnBreak, PageBreak } from './formatting/break'; import { Bookmark, ExternalHyperlink, InternalHyperlink } from './links'; import { Math } from './math'; import { IParagraphPropertiesOptions } from './properties'; import { ImageRun, Run, SequentialIdentifier, SimpleField, SimpleMailMergeField, SymbolRun, TextRun } from './run'; import { Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments } from './run/comment-run'; export type ParagraphChild = TextRun | ImageRun | SymbolRun | Bookmark | PageBreak | ColumnBreak | SequentialIdentifier | FootnoteReferenceRun | InternalHyperlink | ExternalHyperlink | InsertedTextRun | DeletedTextRun | Math | SimpleField | SimpleMailMergeField | Comments | Comment | CommentRangeStart | CommentRangeEnd | CommentReference | CheckBox; export type IParagraphOptions = { readonly text?: string; readonly children?: readonly ParagraphChild[]; } & IParagraphPropertiesOptions; export declare class Paragraph extends FileChild { private readonly properties; constructor(options: string | IParagraphOptions); prepForXml(context: IContext): IXmlableObject | undefined; addRunToFront(run: Run): Paragraph; }