docx
    Preparing search index...

    Type Alias PatchDocumentOptions<T>

    Options for patching a document.

    type PatchDocumentOptions<
        T extends PatchDocumentOutputType = PatchDocumentOutputType,
    > = {
        data: InputDataType;
        endnotes?: Readonly<Record<string, { children: readonly Paragraph[] }>>;
        footnotes?: Readonly<Record<string, { children: readonly Paragraph[] }>>;
        keepOriginalStyles?: boolean;
        numbering?: INumberingOptions;
        outputType: T;
        pageNumbers?: TemplatePageNumberEstimator;
        patches: Readonly<Record<string, IPatch | TableRowsPatch | DrawingPatch>>;
        placeholderDelimiters?: Readonly<{ end: string; start: string }>;
        properties?: PatchDocumentProperties;
        recursive?: boolean;
        trimPlaceholders?: boolean;
    }

    Type Parameters

    Index

    The input document to patch

    endnotes?: Readonly<Record<string, { children: readonly Paragraph[] }>>

    The endnotes that patches refer to with an EndnoteReferenceRun

    footnotes?: Readonly<Record<string, { children: readonly Paragraph[] }>>

    The footnotes that patches refer to with a FootnoteReferenceRun

    keepOriginalStyles?: boolean

    Whether to preserve original text formatting

    numbering?: INumberingOptions

    The lists that the paragraphs in patches use, by their references

    outputType: T

    Desired output format (buffer, blob, string, etc.)

    Works out the page each bookmark is on, to write the page numbers of page references

    patches: Readonly<Record<string, IPatch | TableRowsPatch | DrawingPatch>>

    Map of placeholder keys to patch definitions

    placeholderDelimiters?: Readonly<{ end: string; start: string }>

    Custom delimiter characters for placeholders

    The document's properties to set, such as its title

    recursive?: boolean

    Whether to replace every occurrence of a placeholder in a paragraph, rather than only the first

    trimPlaceholders?: boolean

    Whether to patch a placeholder with spaces inside its delimiters, such as {{ name }}