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;
        outputType: T;
        pageNumbers?: TemplatePageNumberEstimator;
        patches: Readonly<Record<string, IPatch | TableRowsPatch | DrawingPatch>>;
        placeholderDelimiters?: Readonly<{ end: string; start: string }>;
        recursive?: 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

    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

    recursive?: boolean

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